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

Unified exceptions and better exception handling #167

Merged
merged 6 commits into from
Aug 10, 2015

Conversation

analogue
Copy link
Contributor

@analogue analogue commented Aug 8, 2015

Fixes #153

bravado.exception.HTTPError is raised consistently by both Requests and Fido clients.
bravado_core.exception.SwaggerMappingError is raised during swagger outgoing request processing or swagger incoming response processing failures.

The exception story:

  • When there is no response_callback (just a plain old http req/resp) then HTTPError is raised
  • When making a service call that fails with a 5XX, then HTTPError is raised with minimal info
  • When making a service call that succeeds, no exception is raised
  • When making a service call that has a non-2XX response that matches a response in the spec, a HTTPError is raised with the swagger_result noted in the spec
  • When making a service call that has a non-2XX response that doesn't match any responses in the spec, then HTTPError is raised without a swagger_result

Depends on Yelp/bravado-core#39

@bpicolo
Copy link
Contributor

bpicolo commented Aug 10, 2015

Lg2m : ).

travis failing expecting a bravado-core version that's not on pypi:
No matching distribution found for bravado-core>=2.3.0 (from bravado==3.0.0)

@dnephin
Copy link
Contributor

dnephin commented Aug 10, 2015

lgtm once travis is green

analogue added a commit that referenced this pull request Aug 10, 2015
Refactored bravado.exception.HTTPError - now consistently thrown by all http_clients
@analogue analogue merged commit ce56be2 into Yelp:master Aug 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants