Fix swallowed query-parse errors in request handler

The logging call passed the exception as a positional argument with no
%s placeholder in the format string:

    LOGGER.error("Error parsing query: ", e)

Python's logging applies msg % args, which raised TypeError (not all
arguments converted during string formatting) inside logging.handleError.
The logging framework swallows that secondary error, so neither the
intended message nor the exception was ever recorded.

Use an f-string so the exception is actually rendered and logged.
This commit is contained in:
sven authored and Sven Luthi committed 2026-08-11 11:10:20 +02:00
1 parent 1b0008af4f
commit c6c7cf70ec
1 file changed
+1 -1
+1 -1
View File
@@ -319,7 +319,7 @@ class DNSBaseRequestHandler(socketserver.BaseRequestHandler):
return
except Exception as e:
LOGGER.error("Error parsing query: ", e)
LOGGER.error(f"Error parsing query: {e}")
return
# If there was no question in the query, refuse