From 50816be0c12fecae85359398fd4b1dd4b1d58f8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Figueiredo?= Date: Fri, 1 Mar 2024 09:45:28 -0300 Subject: [PATCH 1/2] Add exception handling for Tor option --- sherlock/sherlock.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sherlock/sherlock.py b/sherlock/sherlock.py index a8760f2f9..fc62b55c0 100644 --- a/sherlock/sherlock.py +++ b/sherlock/sherlock.py @@ -200,7 +200,12 @@ def sherlock( # Create session based on request methodology if tor or unique_tor: # Requests using Tor obfuscation - underlying_request = TorRequest() + try: + underlying_request = TorRequest() + except OSError: + print("Tor is not available on your system!") + sys.exit(query_notify.finish()) + underlying_session = underlying_request.session else: # Normal requests From dc5d6d6d6662942699b9435daca18da350af2a19 Mon Sep 17 00:00:00 2001 From: Paul Pfeister Date: Mon, 13 May 2024 01:07:17 -0400 Subject: [PATCH 2/2] Set more specific err msg --- sherlock/sherlock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sherlock/sherlock.py b/sherlock/sherlock.py index fc62b55c0..567b573b5 100644 --- a/sherlock/sherlock.py +++ b/sherlock/sherlock.py @@ -203,7 +203,7 @@ def sherlock( try: underlying_request = TorRequest() except OSError: - print("Tor is not available on your system!") + print("Tor not found in system path. Unable to continue.\n") sys.exit(query_notify.finish()) underlying_session = underlying_request.session