Support for new Flask errorhandling
This commit is contained in:
@@ -17,6 +17,7 @@ from flask import (
|
||||
)
|
||||
|
||||
from pypuppetdb import connect
|
||||
from pypuppetdb.errors import EmptyResponseError
|
||||
from pypuppetdb.QueryBuilder import *
|
||||
|
||||
from puppetboard.forms import (CatalogForm, QueryForm)
|
||||
@@ -115,10 +116,14 @@ class NoContent(ex.HTTPException):
|
||||
|
||||
abort.mapping[204] = NoContent
|
||||
|
||||
|
||||
@app.errorhandler(204)
|
||||
def no_content(e):
|
||||
return '', 204
|
||||
try:
|
||||
@app.errorhandler(204)
|
||||
def no_content(e):
|
||||
return '', 204
|
||||
except KeyError:
|
||||
@app.errorhandler(EmptyResponseError)
|
||||
def no_content(e):
|
||||
return '', 204
|
||||
|
||||
|
||||
@app.errorhandler(400)
|
||||
|
||||
Reference in New Issue
Block a user