Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Python Api binding accessing api error codes for looping


#1

Hi,

I am wanting to access the error codes for the python 3.5 api binding so if a 400 or 401 error is produced from entering incorrect auth or test ids the user can be looped back to enter it again using a if statement. What code would I use to access these?


#2

Hi Sinclair,

Thanks for your posting. The error code is usually included in the error message of the exception but you can also modify the API binding slightly and use a more structured way to return it to the caller.

Cheers,
Tobias