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

[W.I.P.] send error message from response to tapioca exception. #124

Closed
wants to merge 1 commit into from

Conversation

tarsisazevedo
Copy link

Related to #95

@filipeximenes
Copy link
Contributor

@tarsisazevedo what I had in mind (and I think we can get a more general solution) was something that the person writing the wrapper could be in control. So the magic would happen in the TapiocaAdapter. Doing this on the Tapioca class will make us tied to a single way of handling errors that might not be the way many APIs do it.

process_response is the place to handle errors: https://github.com/vintasoftware/tapioca-wrapper/blob/master/tapioca/adapters.py#L54
It's also the place where we raise exceptions. What I had in mind was that it was possible to pass the specific error message there. Your approach of looking for errorin the response may be the default implementation (and should happen after we get the request data https://github.com/vintasoftware/tapioca-wrapper/blob/master/tapioca/adapters.py#L58), but clients will be able to overwrite it and look for the error somewhere else in the response.

Thoughts?

@filipeximenes
Copy link
Contributor

Just to make it more clear, the final behaviour will be: the exception message will be the one that came from the API and not the generic one in here.

@tarsisazevedo tarsisazevedo changed the title send error message from response to tapioca exception. [W.I.P.] send error message from response to tapioca exception. Nov 10, 2016
@fjsj
Copy link
Member

fjsj commented Jun 6, 2023

Closing due to inactivity.

@fjsj fjsj closed this Jun 6, 2023
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.

3 participants