Commits

Adam Rothman committed e8e1cf1

Replace self._message with self.message in TransmissionError to fix a bug that made error messages inaccessible.

Comments (0)

Files changed (1)

transmissionrpc/error.py

     """
     def __init__(self, message='', original=None):
         Exception.__init__(self)
-        self._message = message
+        self.message = message
         self.original = original
 
     def __str__(self):
         if self.original:
             original_name = type(self.original).__name__
-            return '%s Original exception: %s, "%s"' % (self._message, original_name, str(self.original))
+            return '%s Original exception: %s, "%s"' % (self.message, original_name, str(self.original))
         else:
-            return self._message
+            return self.message
 
 class HTTPHandlerError(Exception):
     """
         Exception.__init__(self)
         self.url = ''
         self.code = 600
-        self._message = ''
+        self.message = ''
         self.headers = {}
         self.data = ''
         if isinstance(httpurl, (str, unicode)):
         if isinstance(httpcode, (int, long)):
             self.code = httpcode
         if isinstance(httpmsg, (str, unicode)):
-            self._message = httpmsg
+            self.message = httpmsg
         if isinstance(httpheaders, dict):
             self.headers = httpheaders
         if isinstance(httpdata, (str, unicode)):
             self.data = httpdata
 
     def __repr__(self):
-        return '<HTTPHandlerError %d, %s>' % (self.code, self._message)
+        return '<HTTPHandlerError %d, %s>' % (self.code, self.message)
 
     def __str__(self):
-        return 'HTTPHandlerError %d: %s' % (self.code, self._message)
+        return 'HTTPHandlerError %d: %s' % (self.code, self.message)
 
     def __unicode__(self):
-        return u'HTTPHandlerError %d: %s' % (self.code, self._message)
+        return u'HTTPHandlerError %d: %s' % (self.code, self.message)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.