From e35924ec228212e2aeaaa8a5f7f2bb326e8ed9e3 Mon Sep 17 00:00:00 2001 From: fukusuket <41001169+fukusuket@users.noreply.github.com> Date: Sat, 8 Jul 2023 12:11:25 +0900 Subject: [PATCH] fix: [crawler] add exception handing for ping_lacus --- bin/lib/crawlers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/lib/crawlers.py b/bin/lib/crawlers.py index 7c98537e..90e18fe4 100755 --- a/bin/lib/crawlers.py +++ b/bin/lib/crawlers.py @@ -1795,7 +1795,11 @@ def ping_lacus(): ping = False req_error = {'error': 'Lacus URL undefined', 'status_code': 400} else: - ping = lacus.is_up + try: + ping = lacus.is_up + except: + req_error = {'error': 'Failed to connect Lacus URL', 'status_code': 400} + ping = False update_lacus_connection_status(ping, req_error=req_error) return ping