Skip to main content

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


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)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page