Merge pull request #484 from r0fls/483
use getattr for request url in error handler
This commit is contained in:
commit
435dc72aa1
|
@ -53,10 +53,11 @@ class ErrorHandler:
|
|||
except Exception:
|
||||
self.log(format_exc())
|
||||
if self.debug:
|
||||
url = getattr(request, 'url', 'unknown')
|
||||
response_message = (
|
||||
'Exception raised in exception handler "{}" '
|
||||
'for uri: "{}"\n{}').format(
|
||||
handler.__name__, request.url, format_exc())
|
||||
handler.__name__, url, format_exc())
|
||||
log.error(response_message)
|
||||
return text(response_message, 500)
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user