aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPjotr Prins2016-10-02 12:02:46 +0000
committerPjotr Prins2016-10-02 12:02:46 +0000
commit2115fcfde74375252f556153d48f52f4d15fb298 (patch)
tree861553805efc0effd2bb8b800620f83dc6ae67f2
parent1107259dc258d0cfcb447519cc36e59e78facdef (diff)
downloadgenenetwork2-2115fcfde74375252f556153d48f52f4d15fb298.tar.gz
Error page: trim error messages
-rw-r--r--wqflask/wqflask/templates/error.html6
-rw-r--r--wqflask/wqflask/views.py4
2 files changed, 7 insertions, 3 deletions
diff --git a/wqflask/wqflask/templates/error.html b/wqflask/wqflask/templates/error.html
index 95485f1e..7ab2bf2f 100644
--- a/wqflask/wqflask/templates/error.html
+++ b/wqflask/wqflask/templates/error.html
@@ -25,11 +25,15 @@
to reproduce this ERROR. Next to those steps, copy-paste below
stack trace, either as
a <a href="https://github.com/genenetwork/genenetwork2/issues/new">new
- issue</a> (GeneNetwork error: {{message}}) or E-mail this full page to one of the developers
+ issue</a> or E-mail this full page to one of the developers
directly.
</p>
</div>
+ <p>
+ (GeneNetwork error: {{message[:128]}})
+ </p>
+
<pre>
{{ stack[0] }}
{{ message }} (error)
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 7abcc17d..cf316bee 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -103,7 +103,7 @@ def handle_bad_request(e):
# Handle random animations
# Use a cookie to have one animation on refresh
- animation = request.cookies.get(err_msg)
+ animation = request.cookies.get(err_msg[:64])
if not animation:
list = [fn for fn in os.listdir("./wqflask/static/gif/error") if fn.endswith(".gif") ]
animation = random.choice(list)
@@ -111,7 +111,7 @@ def handle_bad_request(e):
resp = make_response(render_template("error.html",message=err_msg,stack=formatted_lines,error_image=animation))
# logger.error("Set cookie %s with %s" % (err_msg, animation))
- resp.set_cookie(err_msg,animation)
+ resp.set_cookie(err_msg[:64],animation)
return resp
@app.route("/")