How to use the easypost.errors.HttpError function in easypost

To help you get started, we’ve selected a few easypost 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 EasyPost / easypost-python / easypost / api.py View on Github external
url = self.build_url(path)
        headers = self.build_headers(headers)

        print(data)
        try:
            resp = requests.request(
                method,
                url,
                headers=headers,
                params=params,
                data=data,
                timeout=self.timeout,
                verify=True
            )
        except Exception:
            raise HttpError()

        self.handle_api_error(resp)
        return resp.json()  # FIXME: this is only safe if ApiError has already run .json()
github EasyPost / easypost-python / easypost / errors.py View on Github external
def __init__(self, message=''):
        super(HttpError, self).__init__(message or self.message)