Skip to content

Error handling in Ruby SDK #16

Description

@iajrz

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?

Activity

  1. Svisstack commented on Jan 19, 2018

    @Svisstack
    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?

  2. iajrz commented on Jan 19, 2018

    @iajrz
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions