Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing exception class for '502 Bad Gateway' response code. #2078

Merged
merged 1 commit into from
Aug 9, 2016
Merged

Add missing exception class for '502 Bad Gateway' response code. #2078

merged 1 commit into from
Aug 9, 2016

Conversation

tseaver
Copy link
Contributor

@tseaver tseaver commented Aug 9, 2016

We do see such (transient) errors in the wild.

We do see such (transient) errors in the wild.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 9, 2016
@@ -151,6 +151,11 @@ class MethodNotImplemented(ServerError):
code = 501


class BadGateway(ServerError):
"""Exception mapping a '502 Bad Gateway' response."""
code = 502

This comment was marked as spam.

@dhermes
Copy link
Contributor

dhermes commented Aug 9, 2016

LGTM (aside from my question, we can address outside of this)

@tseaver tseaver merged commit bd5273e into googleapis:master Aug 9, 2016
@tseaver tseaver deleted the add-502-exception-class branch August 9, 2016 22:18
@dhermes
Copy link
Contributor

dhermes commented Aug 9, 2016

@tseaver Why not use six.moves.http_client.BAD_GATEWAY and siblings?

@tseaver
Copy link
Contributor Author

tseaver commented Aug 9, 2016

Those constants don't seem to me to add any value here: the actual code is what matters, and we are mapping to our own class hierarchy.

@dhermes
Copy link
Contributor

dhermes commented Aug 9, 2016

It's just more canonical than a bunch of constant int values scatterred around

@tseaver
Copy link
Contributor Author

tseaver commented Aug 10, 2016

They are hardly "scattered": each one is in the class which defines its meaning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: core cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants