Handler mixin for writing JSON errors
Project description
Handler mixin for writing JSON errors
Installation
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
Documentation
Requirements
Example
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,
web.RequestHandler):
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 https://sprocketsmixinsjson_error.readthedocs.org/en/latest/history.html
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
Built Distribution
File details
Details for the file sprockets.mixins.json_error-1.0.0.tar.gz
.
File metadata
- Download URL: sprockets.mixins.json_error-1.0.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e957906f8671c64ac01b87eb7aba7000542dfd98f6b8bbc13b65699b0075977b |
|
MD5 | 3855bbce48f432e173adf52d24088873 |
|
BLAKE2b-256 | 2df83b71e9a7763410d9240192ea860ac3ca7fe1b11d06e83a585fd593b5aa90 |
File details
Details for the file sprockets.mixins.json_error-1.0.0-py2.py3-none-any.whl
.
File metadata
- Download URL: sprockets.mixins.json_error-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4392b773459466d11ea59b144227b2c2499fb1d26ebc04a0c62998c02ad16b11 |
|
MD5 | 1eb08984aa7d78796f6bb8fc78969d9a |
|
BLAKE2b-256 | 614b994a3405513066edeea64c8f46973a12c9b96fdf94b21e420b7fc1f4b4ba |