From 0fcb11be35c7f30ca756801f149eae233ce94e40 Mon Sep 17 00:00:00 2001 From: Mathhew Date: Thu, 25 Nov 2021 09:26:15 +0800 Subject: [PATCH] Fix: raise exception in get html catching exception won't work in methods, eg javbus --- ADC_function.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ADC_function.py b/ADC_function.py index b9b89fd..7686f8b 100644 --- a/ADC_function.py +++ b/ADC_function.py @@ -52,12 +52,13 @@ def get_html(url, cookies: dict = None, ua: str = None, return_type: str = None, return result.text except requests.exceptions.ProxyError: print("[-]Proxy error! Please check your Proxy") - return + raise requests.exceptions.ProxyError except Exception as e: print("[-]Connect retry {}/{}".format(i + 1, configProxy.retry)) errors = str(e) print('[-]Connect Failed! Please check your Proxy or Network!') print("[-]" + errors) + raise Exception('Connect Failed') def post_html(url: str, query: dict, headers: dict = None) -> requests.Response: