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

Return error tuple instead of raising errors #81

Closed
wants to merge 4 commits into from

Conversation

gdub01
Copy link
Contributor

@gdub01 gdub01 commented May 26, 2017

I found I have to write extra code to handle the raises. This way the
user gets to choose whether to raise.

When googling around, noticed it was also brought up here:
https://elixirforum.com/t/error-handling-with-tesla/4511/4

I found I have to write extra code to handle the raises. This way the
user gets to choose whether to raise.

When googling around, noticed it was also brought up here:
https://elixirforum.com/t/error-handling-with-tesla/4511/4
@teamon
Copy link
Member

teamon commented May 26, 2017

This issue has been brought up in the past - #64
Please mind that changing this behaviour would be a major breaking change.
I'm open to changes, but there must a be good reason for them.

The current behaviour is to return %Tesla.Env on successful transaction and raise on adapter/connection errors. As you can is in #64 it is trivial to change this behaviour with a middleware and does not require any changes to the core.

@gdub01
Copy link
Contributor Author

gdub01 commented May 26, 2017

ahh - sorry. Definitely should've thought of the middleware approach. I may close this then as that will do the trick. Ty

@gdub01 gdub01 closed this May 26, 2017
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.

2 participants