[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [sbws/master] circuitbuilder: catch exception stopping sbws
commit ca8aff137e15544d1619d3f26d4d4ad659b080d5
Author: juga0 <juga@xxxxxxxxxx>
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 mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits