commit ca8aff137e15544d1619d3f26d4d4ad659b080d5 Author: juga0 juga@riseup.net Date: Tue Jan 8 14:39:46 2019 +0000
circuitbuilder: catch exception stopping sbws --- sbws/lib/circuitbuilder.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sbws/lib/circuitbuilder.py b/sbws/lib/circuitbuilder.py index 948e680..aa70156 100644 --- a/sbws/lib/circuitbuilder.py +++ b/sbws/lib/circuitbuilder.py @@ -1,5 +1,5 @@ from stem import CircuitExtensionFailed, InvalidRequest, ProtocolError, Timeout -from stem import InvalidArguments, ControllerError +from stem import InvalidArguments, ControllerError, SocketClosed import random from .relaylist import Relay import logging @@ -61,8 +61,9 @@ class CircuitBuilder: c.get_circuit(circ_id, default=None) try: c.close_circuit(circ_id) - except (InvalidArguments, InvalidRequest): - pass + # SocketClosed will be raised when stopping sbws + except (InvalidArguments, InvalidRequest, SocketClosed) as e: + log.debug(e) self.built_circuits.discard(circ_id) except (ControllerError, ValueError) as e: log.exception("Error trying to get circuit to close it: %s.", e)
tor-commits@lists.torproject.org