Went on a PEP-8 rampage
This commit is contained in:
parent
f99ad30fb6
commit
0948c9308a
36 changed files with 186 additions and 218 deletions
|
|
@ -2,6 +2,7 @@ from flask import jsonify
|
|||
from werkzeug.exceptions import default_exceptions
|
||||
from werkzeug.exceptions import HTTPException
|
||||
|
||||
|
||||
class JSONExceptionHandler(object):
|
||||
|
||||
def __init__(self, app=None):
|
||||
|
|
@ -24,7 +25,6 @@ class JSONExceptionHandler(object):
|
|||
}
|
||||
return jsonify(response)
|
||||
|
||||
|
||||
def init_app(self, app):
|
||||
self.app = app
|
||||
self.register(HTTPException)
|
||||
|
|
@ -32,4 +32,4 @@ class JSONExceptionHandler(object):
|
|||
self.register(code)
|
||||
|
||||
def register(self, exception_or_code, handler=None):
|
||||
self.app.errorhandler(exception_or_code)(handler or self.std_handler)
|
||||
self.app.errorhandler(exception_or_code)(handler or self.std_handler)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue