Code Monkey home page Code Monkey logo

Comments (3)

braintreeps avatar braintreeps commented on August 14, 2024

Result objects have a deep_errors attribute that returns a flattened list of all errors at all levels. You can simply grab the code of the first error, or grab all of the codes, and take programmatic action based on the codes you see.

Take a look at http://www.braintreepaymentsolutions.com/docs/python/general/validation_errors#all_errors_on_all_levels

Please let us know if deep_errors does not accomplish what you are looking for.

from braintree_python.

foresto avatar foresto commented on August 14, 2024

Right, I'm aware of deep_errors and can get by with it. This issue is really more of a feature request than a bug. The top-level message would be more generally useful if it had a matching code attribute, to bring it into parity with all the other error objects in an ErrorResult. Failing that, it would be nice at least to have documentation indicating which of the errors in deep_errors is represented by the top level message.

from braintree_python.

braintreeps avatar braintreeps commented on August 14, 2024

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.

from braintree_python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.