diff options
Diffstat (limited to 'oauthlib/oauth1/rfc5849/errors.py')
-rw-r--r-- | oauthlib/oauth1/rfc5849/errors.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/oauthlib/oauth1/rfc5849/errors.py b/oauthlib/oauth1/rfc5849/errors.py index ee1c782..978035e 100644 --- a/oauthlib/oauth1/rfc5849/errors.py +++ b/oauthlib/oauth1/rfc5849/errors.py @@ -13,6 +13,7 @@ from oauthlib.common import urlencode, add_params_to_uri class OAuth1Error(Exception): error = None + description = '' def __init__(self, description=None, uri=None, status_code=400, request=None): @@ -35,7 +36,12 @@ class OAuth1Error(Exception): request: Oauthlib Request object """ - self.description = description + self.description = description or self.description + message = '(%s) %s' % (self.error, self.description) + if request: + message += ' ' + repr(request) + super(OAuth1Error, self).__init__(message) + self.uri = uri self.status_code = status_code |