wtoolzexceptions contains core exception logic for web applications.
Project description
wtoolzexceptions
wtoolzexceptions contains core exception logic for web applications
Installation | Getting Up And Running | Examples | API | See Also
wtoolzexceptions contains core exception logic for web applications. The main feature are:
-
Contains error and exception classes and
-
abort function.
Installation
pip install wtoolzexceptions
Getting Up and Running
nox -l
Examples
import flask
from wtoolzexceptions import exceptions
app = flask.Flask(__name__)
@app.errorhandler(exceptions.HTTPException)
def handle_it(e):
res = flask.jsonify(self.to_dict())
res.status_code = self.http_status_code
return res
@app.route("/me")
def boom_me():
raise exceptions.Forbidden()
# When calling /me you will now get 404 status code and JSON response
# as {"error": {"code": "XY", "message": "xy"}}.
API
FIXME
See Also
FIXME
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wtoolzexceptions-0.1.0.tar.gz
(7.1 kB
view hashes)