How to use the mercadopago.errors.Error function in mercadopago

To help you get started, we’ve selected a few mercadopago 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 federicobond / pymercadopago / mercadopago / errors.py View on Github external
res = cause.response
        if res:
            try:
                self.http_status = res.status_code
                self.json_body = res.json()
                self.code = self.json_body['error']
                message = self.json_body['message']
            except (KeyError, ValueError):
                message = str(cause)
        else:
            message = str(cause)

        super().__init__(message)


class AuthenticationError(Error):
    pass


class NotFoundError(Error):
    pass


class BadRequestError(Error):
    pass
github federicobond / pymercadopago / mercadopago / errors.py View on Github external
self.json_body = res.json()
                self.code = self.json_body['error']
                message = self.json_body['message']
            except (KeyError, ValueError):
                message = str(cause)
        else:
            message = str(cause)

        super().__init__(message)


class AuthenticationError(Error):
    pass


class NotFoundError(Error):
    pass


class BadRequestError(Error):
    pass
github federicobond / pymercadopago / mercadopago / errors.py View on Github external
message = str(cause)
        else:
            message = str(cause)

        super().__init__(message)


class AuthenticationError(Error):
    pass


class NotFoundError(Error):
    pass


class BadRequestError(Error):
    pass