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
Release files for sprockets.mixins.json_error 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sprockets.mixins.json_error-1.0.0.tar.gz | 5.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sprockets.mixins.json_error-1.0.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 12.2 kB
Release files / sprockets.mixins.json_error-1.0.0.tar.gz
| Download URL | sprockets.mixins.json_error-1.0.0.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e957906f8671c64ac01b87eb7aba7000542dfd98f6b8bbc13b65699b0075977b
|
|
BLAKE2b-256 checksum How to use checksums |
2df83b71e9a7763410d9240192ea860ac3ca7fe1b11d06e83a585fd593b5aa90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / sprockets.mixins.json_error-1.0.0-py2.py3-none-any.whl
| Download URL | sprockets.mixins.json_error-1.0.0-py2.py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
4392b773459466d11ea59b144227b2c2499fb1d26ebc04a0c62998c02ad16b11
|
|
BLAKE2b-256 checksum How to use checksums |
614b994a3405513066edeea64c8f46973a12c9b96fdf94b21e420b7fc1f4b4ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |