]> git.ipfire.org Git - dbl.git/commitdiff
sources: Log an error if we could not parse anything
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 10 Dec 2025 12:56:19 +0000 (12:56 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 10 Dec 2025 12:56:19 +0000 (12:56 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/dnsbl/sources.py

index fa5d6d4bd4d7e0376d8efe83f957ceb6877be316..c6fdb968ebe7115bafa17d2bbf9260c66e0db76d 100644 (file)
@@ -214,6 +214,11 @@ class Source(sqlmodel.SQLModel, database.BackendMixin, table=True):
                                                except ValueError as e:
                                                        log.warning("Failed to add '%s' to the database: %s" % (domain, e))
 
+                                       # Log an error if we could not detect the format
+                                       if format is None:
+                                               log.error("Format of '%s' (%s) seems to be unkown. No data could be parsed" \
+                                                       % (self, self.url))
+
                                # The list has now been updated
                                self.updated_at = sqlmodel.func.current_timestamp()