Commit 57f42bd76e270ab4fe3c0be7661658e552cff799

Authored by Goutte
1 parent b2837a08

Log the abortions.

Showing 1 changed file with 6 additions and 1 deletions   Show diff stats
@@ -15,7 +15,7 @@ from pprint import pprint @@ -15,7 +15,7 @@ from pprint import pprint
15 from csv import writer as csv_writer 15 from csv import writer as csv_writer
16 from yaml import load as yaml_load 16 from yaml import load as yaml_load
17 from flask import Flask 17 from flask import Flask
18 -from flask import redirect, url_for, send_from_directory, abort 18 +from flask import redirect, url_for, send_from_directory, abort as abort_flask
19 from flask import request 19 from flask import request
20 from jinja2 import Environment, FileSystemLoader 20 from jinja2 import Environment, FileSystemLoader
21 from netCDF4 import Dataset 21 from netCDF4 import Dataset
@@ -122,6 +122,11 @@ tpl_global_vars = { @@ -122,6 +122,11 @@ tpl_global_vars = {
122 122
123 # HELPERS ##################################################################### 123 # HELPERS #####################################################################
124 124
  125 +def abort(code, message):
  126 + log.error(message)
  127 + abort_flask(code, message)
  128 +
  129 +
125 def render_view(view, context=None): 130 def render_view(view, context=None):
126 """ 131 """
127 A simple helper to render [view] template with [context] vars. 132 A simple helper to render [view] template with [context] vars.