From 029f2af95f42c2623f69879e9f571a69de70982a Mon Sep 17 00:00:00 2001 From: Eric Wollesen Date: Fri, 1 Dec 2023 08:45:35 -0700 Subject: [PATCH] always return an error when there's a message As reported in code review, returning an error is the best indicator that something has gone wrong. BACK-2500 --- api/clinicianInvites.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/clinicianInvites.go b/api/clinicianInvites.go index c2e3ec93..30dd16f5 100644 --- a/api/clinicianInvites.go +++ b/api/clinicianInvites.go @@ -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)