Send 404 instead of 500 for FileNotFoundError.
This commit is contained in:
parent
21cd407070
commit
f48078c83a
1 changed files with 4 additions and 1 deletions
|
@ -664,7 +664,10 @@ def markdown_flask(core_filename, port, *args, **kwargs):
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def do_md_for(filename):
|
def do_md_for(filename):
|
||||||
html = markdown(md=cat_file(filename), *args, **kwargs)
|
try:
|
||||||
|
html = markdown(md=cat_file(filename), *args, **kwargs)
|
||||||
|
except FileNotFoundError:
|
||||||
|
flask.abort(404)
|
||||||
refresh = request.args.get('refresh', None)
|
refresh = request.args.get('refresh', None)
|
||||||
if refresh is not None:
|
if refresh is not None:
|
||||||
refresh = 1000 * max(float(refresh), 1)
|
refresh = 1000 * max(float(refresh), 1)
|
||||||
|
|
Loading…
Reference in a new issue