Skip to content

Commit

Permalink
Add error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Robi9 committed Oct 18, 2024
1 parent ff74bf7 commit 4df2b34
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backends/rapidpro/contact.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,15 @@ func contactForURNTeams(ctx context.Context, b *backend, urn urns.URN, org OrgID
return nil, err
}

if err == sql.ErrNoRows {
return nil, err
}

err = updateContactTeamsURN(b.db, contact.URNID_, urn.Identity().String())
if err != nil {
logrus.WithError(err).WithField("urn", urn.Identity()).WithField("org_id", org).Error("error updating contact urn")
return contact, err
}

return contact, nil
}

Expand Down

0 comments on commit 4df2b34

Please sign in to comment.