mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-08-06 01:37:25 +08: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:
@ -22,7 +22,7 @@ func GenerateActionsRunnerToken(ctx context.Context, scope string) (string, Resp
|
||||
})
|
||||
|
||||
resp, extra := requestJSONResp(req, &responseText{})
|
||||
if resp == nil {
|
||||
if extra.HasError() {
|
||||
return "", extra
|
||||
}
|
||||
return resp.Text, extra
|
||||
|
Reference in New Issue
Block a user