# HG changeset patch # User BenoƮt Allard # Date 1414486518 -3600 # Node ID ce39a5267998e465638f7fb7f8a45c70323e2d29 # Parent 3a56d5501ffa881b72a29f9dcb08f6815d6d40e3 Add an export to the error page, and an exploding endpoint diff -r 3a56d5501ffa -r ce39a5267998 farol/main.py --- a/farol/main.py Mon Oct 27 16:46:18 2014 +0100 +++ b/farol/main.py Tue Oct 28 09:55:18 2014 +0100 @@ -38,7 +38,7 @@ import flask from flask import (Flask, request, render_template, redirect, url_for, flash, - make_response) + make_response, abort) from werkzeug import secure_filename from . import __version__, cache @@ -94,6 +94,10 @@ def error_page(error): return render_template('error.j2', e=error), getattr(error, 'code', 500) +@app.route('/500') +def boom(): + abort(500) + @app.route('/') def welcome(): return render_template('welcome.j2', diff -r 3a56d5501ffa -r ce39a5267998 farol/templates/error.j2 --- a/farol/templates/error.j2 Mon Oct 27 16:46:18 2014 +0100 +++ b/farol/templates/error.j2 Tue Oct 28 09:55:18 2014 +0100 @@ -9,7 +9,19 @@ {% if e.description %}

{{ e.description }}


{% endif %} {% if e.code != 404 %}

Software are not without bugs. Looks like, you found one ... A trace has been written to the logs.

-

If you keep coming to this page, you might want to delete your document, and start again with a fresh one ...

-
{{ POST_button(url_for('document.delete'), text="Delete document", style="btn-danger") }}
+
+
+
+

If you keep coming to this page, you might want to delete your document, and start again with a fresh one ...

+
{{ POST_button(url_for('document.delete'), text="Delete document", style="btn-danger") }}
+
+
+
+
+

First, you might want to download your document (if it works !)

+

Download document

+
+
+
{% endif %} {% endblock %}