[tor-commits] [stem/master] Setting string attribute of OperationFailed

atagar at torproject.org atagar at torproject.org
Wed Aug 22 01:12:46 UTC 2012


commit 75d7f077e4b23361bc163171a4ec38b137f019ee
Author: Damian Johnson <atagar at torproject.org>
Date:   Sat Aug 18 11:36:38 2012 -0700

    Setting string attribute of OperationFailed
    
    All OperationFailed subclasses had an empty string attribute, making stack
    traces pretty unhelpful.
    
    Before:
    
    >>> control.get_info('blarg')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "stem/control.py", line 622, in get_info
        if default == UNDEFINED: raise exc
    stem.socket.InvalidArguments
    
    After:
    
    >>> control.get_info('blarg')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "stem/control.py", line 622, in get_info
        if default == UNDEFINED: raise exc
    stem.socket.InvalidArguments: GETINFO request contained unrecognized keywords: blarg
---
 stem/socket.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/stem/socket.py b/stem/socket.py
index 5492e30..e76e841 100644
--- a/stem/socket.py
+++ b/stem/socket.py
@@ -570,7 +570,7 @@ class OperationFailed(ControllerError):
     :returns: object of OperationFailed class
     """
     
-    super(ControllerError, self).__init__()
+    super(ControllerError, self).__init__(message)
     self.code = code
     self.message = message
 





More information about the tor-commits mailing list