Selaa lähdekoodia

return better error message when err is ErrSmtpNotEnabled

fixes #12087
thurt 7 vuotta sitten
vanhempi
commit
b487aa3e6a
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      pkg/api/org_invite.go

+ 3 - 0
pkg/api/org_invite.go

@@ -74,6 +74,9 @@ func AddOrgInvite(c *m.ReqContext, inviteDto dtos.AddInviteForm) Response {
 		}
 
 		if err := bus.Dispatch(&emailCmd); err != nil {
+			if err == m.ErrSmtpNotEnabled {
+				return Error(412, err.Error(), err)
+			}
 			return Error(500, "Failed to send email invite", err)
 		}