Closed Bug 1191811 Opened 9 years ago Closed 9 years ago

Fix WebAPIError http status codes

Categories

(MozReview Graveyard :: General, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1191808

People

(Reporter: mdoglio, Unassigned)

References

Details

Moved from https://bugzilla.mozilla.org/show_bug.cgi?id=1109218#c144:

+++ b/pylib/mozreview/mozreview/autoland/errors.py
> +AUTOLAND_TIMEOUT = WebAPIError(
> +    902,
> +    "Autoland failed to respond within the allowed time",
> +    http_status=502)  # 502 Bad Gateway
"504 Gateway Timeout".

+++ b/pylib/mozreview/mozreview/autoland/errors.py
> +BAD_AUTOLAND_CREDENTIALS = WebAPIError(
> +    903,
> +    "Bad or missing Autoland credentials.",
> +    http_status=401)  # 401 Unauthorized
I'd say this is a 500 not 401 - It's dealing with credentials but internal
server configured ones, not those passed to RB as part of the request.

Also, we're only returning this error if the credentials aren't configured, not
if they're bad credentials. I think the message should be more like that of
BAD_AUTOLAND_URL. We could probably even combine this and BAD_AUTOLAND_URL into
a single autoland configuration error.

+++ b/pylib/mozreview/mozreview/autoland/errors.py
> +BAD_UPDATE_CREDENTIALS = WebAPIError(
> +    904,
> +    "Bad or missing AutolandRequest update credentials.",
> +    http_status=401)  # 401 Unauthorized
I think we should just re-use Review Board's PERMISSION_DENIED error here rather
than rolling our own.
Blocks: 1191817
Priority: -- → P2
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
Product: Developer Services → MozReview
You need to log in before you can comment on or make changes to this bug.