Error Handling for Webteh libraries

This guide helps you test and gracefully handle errors returned by the libraries to build a great user experience.

Error types:

Error structure

  • code: int - An error code
  • message: string - Error message. Messages can be parametrized
  • error_id: int - Error log id generated after error occurs.
  • library_error: bool - True when error is generated from library/api. False if error is generated on payment gateway
  • definite_error: bool - True when transaction definitely failed and user was not charged