Skip to main content

Handler mixin for writing JSON errors

Project description

Handler mixin for writing JSON errors

Version Downloads Status Coverage License


sprockets.mixins.json_error is available on the Python Package Index and can be installed via pip or easy_install:

pip install sprockets.mixins.json_error




This examples demonstrates how to use sprockets.mixins.json_error to format errors as JSON.

from sprockets import mixins.json_error
from tornado import web

class MyRequestHandler(json_error.JsonErrorMixin,

    def get(self, *args, **kwargs):
        raise web.HTTPError(404, log_message='My reason')

The response from the handler will automatically be formatted as:

    "message": "My reason",
    "type": "Not Found"

Version History

Available at

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sprockets.mixins.json_error-1.0.0.tar.gz (5.1 kB view hashes)

Uploaded source

Built Distribution

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