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

Add more detail to API exception messages #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

amphibian
Copy link

it was frustrating at times dealing with errors to do with missing or incorrect data, as only the message "title" was being returned via the API Exception class. The REST response includes a details array, so I've merged that into the returned message here.

The formatting is a little arbitrary of course, but it's the best way I could think of to append an unknown number of errors to the message string.

So instead of, e.g.,
"Missing or invalid payment information - Please validate all required payment information."

We return:
"Missing or invalid payment information - Please validate all required payment information. (State/province does not match country; Shipping state/province does not match country.)"
@RyanEwen
Copy link

RyanEwen commented Oct 2, 2020

Someone at Bambora please review this. Our company started to use this SDK and when we get error 314 we're unable to relay any details as to why the card couldn't be charged.

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

Successfully merging this pull request may close these issues.

2 participants