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

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



commit 2fce34d0adc0bd3704f35339f6b75d8171920b45
Author: juga0 <juga@xxxxxxxxxx>
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



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