Skip to content

403 errors with error code and messages are not returned or raised correctly #115

@idl3

Description

@idl3

Describe the bug
When server returns a 403 error with an error code and error message, we only get returned a generic User permissions error that is inaccurate and misleading.

How to reproduce

  • It depends on the backend response, but as long as you have a 403 error from the backend with an error code and message, it will always return "User permissions error".

Expected behavior

  • It should show the correct error message instead of a blanket User permissions error.

Screenshots
Actual Faraday response from a live API call:
CleanShot 2022-12-30 at 10 11 11@2x

Desktop (please complete the following information):

  • ruby Version: 2.7.2
  • Library Version: 6.1.0

Additional context
Trying to make an online payment and getting this error, while trying to debug and fix the user permissions I found that it does not have anything to do with permissions.

The offending line can be found in https://github.com/Adyen/adyen-ruby-api-library/blob/develop/lib/adyen/client.rb#L172

Either the backend is not respecting the exclusive usage of 403 status being a user permissions error or the SDK is not updated to reflect the broader subset of 403 errors that the backend provides.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions