How to use the amadeus.client.errors.ClientError function in amadeus

To help you get started, we’ve selected a few amadeus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github amadeus4dev / amadeus-python / amadeus / mixins / parser.py View on Github external
def error_for(self, status_code, parsed):  # noqa: C901
        if status_code is None:
            return NetworkError
        if status_code >= 500:
            return ServerError
        if status_code == 401:
            return AuthenticationError
        if status_code == 404:
            return NotFoundError
        if status_code >= 400:
            return ClientError
        if not parsed:
            return ParserError