Skip to content

wtoolzexceptions contains core exception logic for web applications

License

Notifications You must be signed in to change notification settings

e-k-m/wtoolzexceptions

Repository files navigation

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

About

wtoolzexceptions contains core exception logic for web applications

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages