From: Michael Tremer Date: Tue, 4 Jul 2023 10:17:19 +0000 (+0000) Subject: geofeeds: Catch any invalid URLs X-Git-Tag: 0.9.17~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6fedd9fd16c1f78548e42b7233f8a4e0a9ba27b;p=location%2Flibloc.git geofeeds: Catch any invalid URLs Signed-off-by: Michael Tremer --- diff --git a/src/scripts/location-importer.in b/src/scripts/location-importer.in index 20527f6..04c0cf9 100644 --- a/src/scripts/location-importer.in +++ b/src/scripts/location-importer.in @@ -19,6 +19,7 @@ import argparse import concurrent.futures +import http.client import ipaddress import json import logging @@ -1428,7 +1429,7 @@ class CLI(object): WHERE geofeed_id = %s", geofeed.id) # Catch any other errors and connection timeouts - except (urllib.request.URLError, TimeoutError) as e: + except (http.client.InvalidURL, urllib.request.URLError, TimeoutError) as e: log.debug("Could not fetch URL %s: %s" % (geofeed.url, e)) self.db.execute("UPDATE geofeeds SET status = %s, error = %s \