1
0
mirror of https://github.com/Tygs/0bin.git synced 2023-08-10 21:13:00 +03:00

Added error404

This commit is contained in:
max 2012-05-02 16:23:26 +07:00
parent 4c97f43a08
commit 4b1697e794
2 changed files with 6 additions and 4 deletions

View File

@ -27,7 +27,7 @@ from src import settings, Paste, drop_privileges
app = Bottle()
@app.route('/')
@view('home')
@ -91,15 +91,17 @@ def display_paste(paste_id):
except (TypeError, ValueError):
#abort(404, u"This paste doesn't exist or has expired")
return error404()
return error404(ValueError)
return {'paste': paste, 'keep_alive': keep_alive, 'max_size': settings.MAX_SIZE, 'max_size_kb': settings.MAX_SIZE_KB}
@app.error(404)
@view('404')
def error404():
def error404(code):
return {'max_size': settings.MAX_SIZE, 'max_size_kb': settings.MAX_SIZE_KB}
@clize.clize
def runserver(host=settings.HOST, port=settings.PORT, debug=settings.DEBUG,
serve_static=settings.DEBUG):

View File

@ -2,7 +2,7 @@
<a class="close" data-dismiss="alert" href="#">×</a>
<strong class="title">Error!</strong>
<span class="message">
This paste no longer exist.
This paste has expired or wrong url, please check again.
</span>
</p>