mirror of
https://github.com/Tygs/0bin.git
synced 2023-08-10 21:13:00 +03:00
Added error404
This commit is contained in:
parent
4c97f43a08
commit
4b1697e794
6
start.py
6
start.py
@ -91,15 +91,17 @@ def display_paste(paste_id):
|
|||||||
|
|
||||||
except (TypeError, ValueError):
|
except (TypeError, ValueError):
|
||||||
#abort(404, u"This paste doesn't exist or has expired")
|
#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}
|
return {'paste': paste, 'keep_alive': keep_alive, 'max_size': settings.MAX_SIZE, 'max_size_kb': settings.MAX_SIZE_KB}
|
||||||
|
|
||||||
|
|
||||||
|
@app.error(404)
|
||||||
@view('404')
|
@view('404')
|
||||||
def error404():
|
def error404(code):
|
||||||
return {'max_size': settings.MAX_SIZE, 'max_size_kb': settings.MAX_SIZE_KB}
|
return {'max_size': settings.MAX_SIZE, 'max_size_kb': settings.MAX_SIZE_KB}
|
||||||
|
|
||||||
|
|
||||||
@clize.clize
|
@clize.clize
|
||||||
def runserver(host=settings.HOST, port=settings.PORT, debug=settings.DEBUG,
|
def runserver(host=settings.HOST, port=settings.PORT, debug=settings.DEBUG,
|
||||||
serve_static=settings.DEBUG):
|
serve_static=settings.DEBUG):
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<a class="close" data-dismiss="alert" href="#">×</a>
|
<a class="close" data-dismiss="alert" href="#">×</a>
|
||||||
<strong class="title">Error!</strong>
|
<strong class="title">Error!</strong>
|
||||||
<span class="message">
|
<span class="message">
|
||||||
This paste no longer exist.
|
This paste has expired or wrong url, please check again.
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user