webconfig: Only include path in error if we have one

This makes for a super misleading error message.

See #7917.
This commit is contained in:
Fabian Homborg 2021-04-10 11:49:40 +02:00
parent e2146a0eee
commit 16d4424f6c

View file

@ -1431,9 +1431,9 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
pass
def log_error(self, format, *args):
if format == "code %d, message %s":
if format == "code %d, message %s" and hasattr(self, 'path'):
# This appears to be a send_error() message
# We want to include the path
# We want to include the path (if we have one)
(code, msg) = args
format = "code %d, message %s, path %s"
args = (code, msg, self.path)