[tor-commits] [sbws/master] Log exception and exit when launching tor fails

pastly at torproject.org pastly at torproject.org
Wed Jul 11 15:05:40 UTC 2018


commit 2fce34d0adc0bd3704f35339f6b75d8171920b45
Author: juga0 <juga at riseup.net>
Date:   Tue Jul 3 08:56:50 2018 +0000

    Log exception and exit when launching tor fails
---
 sbws/util/stem.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sbws/util/stem.py b/sbws/util/stem.py
index 54779fd..7224c10 100644
--- a/sbws/util/stem.py
+++ b/sbws/util/stem.py
@@ -181,8 +181,11 @@ def launch_tor(conf):
                 existing_val.append(value)
                 torrc.update({key: existing_val})
     # Finally launch Tor
-    stem.process.launch_tor_with_config(
-        torrc, init_msg_handler=log.debug, take_ownership=True)
+    try:
+        stem.process.launch_tor_with_config(
+            torrc, init_msg_handler=log.debug, take_ownership=True)
+    except Exception as e:
+        fail_hard('Error trying to launch tor: %s', e)
     # And return a controller to it
     cont = _init_controller_socket(conf['tor']['control_socket'])
     # Because we build things by hand and can't set these before Tor bootstraps





More information about the tor-commits mailing list