mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-28 21:00:03 +02:00
Caller should check the ResponseExtra.HasError() first to see whether the request fails (#28796)
`resp != nil` doesn't mean the request really succeeded. Add a comment for requestJSONResp to clarify the behavior.
This commit is contained in:
parent
637451a45e
commit
b0e6c25535
4 changed files with 4 additions and 3 deletions
|
@ -30,7 +30,7 @@ func SendEmail(ctx context.Context, subject, message string, to []string) (strin
|
|||
})
|
||||
|
||||
resp, extra := requestJSONResp(req, &responseText{})
|
||||
if resp == nil {
|
||||
if extra.HasError() {
|
||||
return "", extra
|
||||
}
|
||||
return resp.Text, extra
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue