You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 18, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 18, 2019. It is now read-only.
Include HTTP status code as part of the error #105
Note that this is only for the case where the service returns a non-200 code, without explicitly returning a coreapi Error response. If the service explicitly returns an error then it can set the title however it wants too.
hm, seams not so easy to me.
my application makes REST Api Calls and uses this client for endpoint abstraction. since I want to make the application more resilient (ex. networking issues, gateway down etc.) I need to now the occured error.
For Example:
503 Service Unavailable: try request again
400 Bad Request: Oops, wrong call, stop
Why do we "coerce" requests into an Coreapi Document Error? It's a Transport Error and not like a ParseError or Coreapi Schema Type Error.
Activity
lovelydinosaur commentedon Oct 3, 2016
Yup, that seems like a reasonable request.
We can change that easily enough, here: https://github.com/core-api/python-client/blob/master/coreapi/transports/http.py#L257
Note that this is only for the case where the service returns a non-200 code, without explicitly returning a coreapi
Errorresponse. If the service explicitly returns an error then it can set the title however it wants too.0asys commentedon Oct 19, 2018
hm, seams not so easy to me.
my application makes REST Api Calls and uses this client for endpoint abstraction. since I want to make the application more resilient (ex. networking issues, gateway down etc.) I need to now the occured error.
For Example:
Why do we "coerce"
requestsinto an Coreapi Document Error? It's a Transport Error and not like aParseErroror Coreapi Schema Type Error.For me its reasonable to let
requestsraise the exception. See http://docs.python-requests.org/en/master/user/quickstart/#response-status-codesWe can do a
response.raise_for_status(), so I can catch that.