def __init__(self, request: FacebookRequest,
                 request_error: FacebookRequestError):
        super().__init__(
            description=request_error.api_error_message(),
            # Generally 500 responses have no is_transient field in payload, even though they are transient
            # in nature.
            is_transient=request_error.api_transient_error()
            or request_error.http_status() == 500,
            data=request_error.body(),
        )

        self.request = request
        self.request_error = request_error
Exemple #2
0
 def _get_exception_description(self, e: FacebookRequestError):
     if e.body() is not None and 'error' in e.body(
     ) and 'message' in e.body()['error']:
         return e.body()['error']['message']
     return "no descriptions"