-
Notifications
You must be signed in to change notification settings - Fork 155
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
ErrorResult could use a top-level 'code' attribute to match the 'message' attribute #6
Comments
Result objects have a Take a look at http://www.braintreepaymentsolutions.com/docs/python/general/validation_errors#all_errors_on_all_levels Please let us know if |
Right, I'm aware of |
The top level message is a string containing all of the error messages (validation errors, processor declined, etc). Since there can be more than one error, there is no one code that matches. We will update the docs to make this more clear. |
The ErrorResult class has a top-level
message
attribute which is a convenient alternative to groveling through the children oferrors
when only the first/main error message is needed for display. Unfortunately, there is no matchingcode
attribute, so there's no good way to take programmatic action based on what kind of error it is.As far as I can tell, there is also no documentation indicating which child of
errors
was used for the top-levelmessage
, so grabbing an error code from there would seem unreliable at best.The text was updated successfully, but these errors were encountered: