coinapi-sdk
coinapi-sdk copied to clipboard
Error handling in Ruby SDK
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?
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?
This behavior doesn't exist. Nothing is raise
d 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.