Commits

Richard Jones committed aebd9b2

fix

Comments (0)

Files changed (2)

 
 class OAuthError(RuntimeError):
     """Generic exception class."""
-    def __init__(self, message='OAuth error occured.'):
-        self.message = message
     def __str__(self):
-        return '%s(%s)' % (self.__class__.__name__, self.message)
+        if not self.args:
+            message = ''
+        else:
+            message = self.args[0]
+        return '%s(%s)' % (self.__class__.__name__, message)
 
 
 def build_authenticate_header(realm=''):
         disallowed.
         '''
         consumer, token, params, user = self._parse_request()
-        return 'Access allowed for %s (ps. I got params=%r)'%(user, params)
-
+        message = 'Access allowed for %s (ps. I got params=%r)'%(user, params)
+        self.write_plain(message)
+