avoid error in error handler and render 500 page

This commit is contained in:
j 2016-08-23 01:37:38 +02:00
parent d7b53aa322
commit b4074303ba
2 changed files with 35 additions and 10 deletions

View file

@ -53,6 +53,7 @@ class ErrorHandler(logging.Handler):
text = "%s\n\n%s" % (stack_trace, request_repr)
if text:
try:
l = models.Log(
text=text,
line=line,
@ -61,3 +62,5 @@ class ErrorHandler(logging.Handler):
if user:
l.user = user
l.save()
except:
pass

View file

@ -1 +1,23 @@
500 error
<!DOCTYPE html>
<html>
<head>
<title>We will be back in a moment.</title>
<link rel="stylesheet" type="text/css" href="/static/oxjs/min/UI/css/UI.css"/>
<style>
body {
text-align: center;
}
img {
width: 256px;
padding-top: 128px;
}
div {
padding-top: 16px;
}
</style>
</head>
<body class="OxThemeOxmedium">
<img src="/static/png/logo.png"/>
<div class="OxSelectable">We will be back in a moment.</div>
</body>
</html>