Skip to content

Commit

Permalink
always return an error when there's a message
Browse files Browse the repository at this point in the history
As reported in code review, returning an error is the best indicator that
something has gone wrong.

BACK-2500
  • Loading branch information
ewollesen committed Dec 4, 2023
1 parent e4730f3 commit 029f2af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/clinicianInvites.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,9 @@ func (a *Api) sendClinicianConfirmation(req *http.Request, confirmation *models.
}

if !a.createAndSendNotification(req, confirmation, emailContent) {
return STATUS_ERR_SENDING_EMAIL, nil
// TODO: better to re-work createAndSendNotification to return a
// proper error.
return STATUS_ERR_SENDING_EMAIL, fmt.Errorf("sending email")
}

a.logMetric("clinician_invite_sent", req)
Expand Down

0 comments on commit 029f2af

Please sign in to comment.