def handle_api_error(self, http_status, http_body, response):
        try:
            error = response['error']
        except (__HOLE__, TypeError):
            raise Error("Invalid response from API: (%d) %r " % (http_status, http_body), http_status, http_body)

        try:
            raise Error(error.get('message', ''), http_status, http_body)
        except AttributeError:
            raise Error(error, http_status, http_body)
dataset/ETHPy150Open EasyPost/easypost-python/easypost/__init__.py/Requestor.handle_api_error