more robust error routine.
self.ctx may be unset in case of bad request or other low-level error.
This commit is contained in:
parent
52d5cba3e9
commit
7f3634bba0
|
|
@ -126,7 +126,12 @@ class AuthHandler(BaseHTTPRequestHandler):
|
||||||
else:
|
else:
|
||||||
addr = "-"
|
addr = "-"
|
||||||
|
|
||||||
sys.stdout.write("%s - %s [%s] %s\n" % (addr, self.ctx['user'],
|
if not hasattr(self, 'ctx'):
|
||||||
|
user = '-'
|
||||||
|
else:
|
||||||
|
user = ctx['user']
|
||||||
|
|
||||||
|
sys.stdout.write("%s - %s [%s] %s\n" % (addr, user,
|
||||||
self.log_date_time_string(), format % args))
|
self.log_date_time_string(), format % args))
|
||||||
|
|
||||||
def log_error(self, format, *args):
|
def log_error(self, format, *args):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue