From c52eb512e87b4f18b4542b934e7c3796a659564f Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 26 Sep 2023 14:29:42 +0200 Subject: [PATCH] UI - Proxy Scanner tool should also understand when a filter is empty or contains only an image --- changedetectionio/blueprint/check_proxies/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/changedetectionio/blueprint/check_proxies/__init__.py b/changedetectionio/blueprint/check_proxies/__init__.py index bb5ed9b2..60c98436 100644 --- a/changedetectionio/blueprint/check_proxies/__init__.py +++ b/changedetectionio/blueprint/check_proxies/__init__.py @@ -57,9 +57,11 @@ def construct_blueprint(datastore: ChangeDetectionStore): status.update({'status': 'ERROR OTHER', 'length': len(contents), 'text': f"Got empty reply with code {e.status_code} - Access denied"}) else: status.update({'status': 'ERROR OTHER', 'length': len(contents) if contents else 0, 'text': f"Empty reply with code {e.status_code}, needs chrome?"}) - + except content_fetcher.ReplyWithContentButNoText as e: + txt = f"Got reply but with no content - Status code {e.status_code} - It's possible that the filters were found, but contained no usable text (or contained only an image)." + status.update({'status': 'ERROR', 'text': txt}) except Exception as e: - status.update({'status': 'ERROR OTHER', 'length': len(contents) if contents else 0, 'text': 'Error: '+str(e)}) + status.update({'status': 'ERROR OTHER', 'length': len(contents) if contents else 0, 'text': 'Error: '+type(e).__name__+str(e)}) else: status.update({'status': 'OK', 'length': len(contents), 'text': ''})