Send 404 instead of 500 for FileNotFoundError.

This commit is contained in:
Ethan Dalool 2020-06-04 10:51:06 -07:00
parent 21cd407070
commit f48078c83a

View file

@ -664,7 +664,10 @@ def markdown_flask(core_filename, port, *args, **kwargs):
return response
def do_md_for(filename):
try:
html = markdown(md=cat_file(filename), *args, **kwargs)
except FileNotFoundError:
flask.abort(404)
refresh = request.args.get('refresh', None)
if refresh is not None:
refresh = 1000 * max(float(refresh), 1)