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 pass
def log_error(self, format, *args): 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 # 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 (code, msg) = args
format = "code %d, message %s, path %s" format = "code %d, message %s, path %s"
args = (code, msg, self.path) args = (code, msg, self.path)