json_file = os.path.join(app.config['UPLOAD_FOLDER'], "{}.json".format(filename))
if os.path.exists(f) and os.path.isfile(json_file):
- with open(json_file) as json_f:
- json_content = json.load(json_f)
- return render_template('analyze_file.html', filename=filename, json=json_content)
+ try:
+ with open(json_file) as json_f:
+ json_content = json.load(json_f)
+ return render_template('analyze_file.html', filename=filename, json=json_content)
+ except ValueError as e:
+ abort(503)
else:
abort(404)