Skip to content

Commit

Permalink
Internally fix developer errors on error responses
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live committed Aug 15, 2023
1 parent 1168a7f commit 13908a9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/_routers/98-use-rcontext.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ beforeParseDownload:
}

// Try to find a suitable error code, if one is needed
if errRes, isError := res.(_responses.ErrorResponse); isError {
res = &errRes // just fix it
}
if errRes, isError := res.(*_responses.ErrorResponse); isError && proposedStatusCode == http.StatusOK {
switch errRes.InternalCode {
case common.ErrCodeUnknownToken:
Expand Down

0 comments on commit 13908a9

Please sign in to comment.