[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [sbws/master] stem: catch exceptions raised when stopping sbws



commit a6e4f06b05eee54a45a3f63eecbd8381a6ff46c0
Author: juga0 <juga@xxxxxxxxxx>
Date:   Tue Jan 8 14:46:06 2019 +0000

    stem: catch exceptions raised when stopping sbws
---
 sbws/util/stem.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/sbws/util/stem.py b/sbws/util/stem.py
index 39c99e4..326bb57 100644
--- a/sbws/util/stem.py
+++ b/sbws/util/stem.py
@@ -1,7 +1,9 @@
+import socks
+
 from stem.control import (Controller, Listener)
 from stem import (SocketError, InvalidRequest, UnsatisfiableRequest,
                   OperationFailed, ControllerError, InvalidArguments,
-                  ProtocolError)
+                  ProtocolError, SocketClosed)
 from stem.connection import IncorrectSocketType
 import stem.process
 from configparser import ConfigParser
@@ -250,8 +252,9 @@ def circuit_str(controller, circ_id):
         log.warning('Circuit %s no longer seems to exist so can\'t return '
                     'a valid circuit string for it: %s', circ_id, e)
         return None
-    except ControllerError as e:
-        log.exception("Exception trying to get circuit string %s", e)
+    # exceptions raised when stopping the scanner
+    except (ControllerError, SocketClosed, socks.GeneralProxyError) as e:
+        log.debug(e)
         return None
     return '[' +\
         ' -> '.join(['{} ({})'.format(n, fp[0:8]) for fp, n in circ.path]) +\



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits