Handle errors with Tor HS configuration.

This commit is contained in:
James Valleroy committed 2014-11-10 21:42:40 -05:00
1 parent e5de76401d
commit 28cc7f14c7
2 files changed
+9 -2

No files matched your search

+5 -2
View File
@@ -198,8 +198,11 @@ def get_hidden_service():
if not hs_dir:
return ''
with open(os.path.join(hs_dir, 'hostname'), 'r') as conf_file:
hs_hostname = conf_file.read().strip()
try:
with open(os.path.join(hs_dir, 'hostname'), 'r') as conf_file:
hs_hostname = conf_file.read().strip()
except Exception:
return 'error'
return hs_hostname + ' ' + ','.join(hs_ports)