-
Notifications
You must be signed in to change notification settings - Fork 13
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 more useful errors #4
Comments
FYI here is the pretty basic logic I have applied in the Ruby gem https://github.com/interfax/interfax-ruby/blob/ccefaf015320403d9ff5eb37bc259a7686500b3f/lib/interfax/client.rb#L116-L128 |
I did that initially but that error class has additional info that could be useful when debugging, and seemed more sensible than copying all that data across into a new hierarchy of errors, open to changing it though. |
@danielknell oh I agree on that. I'm not too worried about wrapping it in new error objects, that's just a convenience. What I am more worried about is that my error exposes the JSON body: {"code":-111,"message":"Attempting to fax to a number that is not the designated fax number in a developer account","moreInfo":null} Which is actually useful to the end user. Your code just tells me |
@danielknell where did we leave this? |
I got weighed down with other stuff and then forgot about it, sorry, i will try and find some time to look soon. |
Thanks @danielknell, any time you might have available to make this change would be much appreciated. |
In the ruby library I've tried to catch most errors and bubble them up in a meaningful way. For example when I send a fax to a number that I'm not yet allowed to send a fax to I get:
In this library I get
The text was updated successfully, but these errors were encountered: