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

Error handling in Ruby SDK #16

Open
iajrz opened this issue Jan 17, 2018 · 2 comments
Open

Error handling in Ruby SDK #16

iajrz opened this issue Jan 17, 2018 · 2 comments

Comments

@iajrz
Copy link
Contributor

iajrz commented Jan 17, 2018

When calling some methods from the SDK, like Client#exchange_rates_get_specific_rate, there are some edge cases - in particular, the test API Key has no access to the "specific exchange rate" endpoint, so it gets a 403.

But the method still tries to parse the date before returning the object, which results in an obscure "nil can't be parsed" sort of error.

Many such details exist.

Does the SDK intend to pass the message object with the error?

@Svisstack
Copy link
Contributor

I think SDK should throw an exception in this case with error message received from the API, such an exception object will unwind a call stack to the user code or beyond.

Can you confirm that such behavior don't exists in the master branch?

@iajrz
Copy link
Contributor Author

iajrz commented Jan 19, 2018

This behavior doesn't exist. Nothing is raised in the Ruby code. I don't see it in Python or C# code either.

I see the Java SDK has error code handling and surfaces it to the coder. Perhaps other implementations should follow suit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants