braintree / braintree_android

Braintree SDK for Android
https://developer.paypal.com/braintree/docs/start/hello-client/android/v4
MIT License
403 stars 231 forks source link

Expose error details in "UnexpectedException" in Python library #1045

Closed charlie-zhang109 closed 1 month ago

charlie-zhang109 commented 1 month ago

Is your feature request related to a problem? Please describe.

General information

Language: python SDK/Library version: 4.28.0

Issue description

When our backend tried to create a customer on BT side, we got the following UnexpectedError without a detailed message.

raise UnexpectedError("Unexpected HTTP_RESPONSE " + str(status))
braintree.exceptions.unexpected_error.UnexpectedError: Unexpected HTTP_RESPONSE 400

From this BT doc, looks like the client library needs to handle it.

Also Java library had this similar issue and it got fixed.

Describe the solution you'd like.

It would be helpful if that error was bubbled up to the exception, or generated a more specific exception like the Java library.

sarahkoop commented 1 month ago

This looks like an issue for the Braintree Python library. Please re-open this issue under the Braintree Python GitHub repository.