RFC-7807 Error documents for Tornado
Project description
This library provides a version of tornado.web.RequestHandler.send_error that speaks application/problem+json instead of HTML.
from tornado import web
import problemdetails
class MyHandler(problemdetails.ErrorWriter, web.RequestHandler):
def get(self):
try:
self.do_something_hard()
except SomeException as error:
self.send_error(500, title="Failed to do_something_hard")
HTTP/1.1 500 Internal Server Error
Content-Type: application/problem+json
{
"title": "Failed to do_something_hard",
"type": "https://tools.ietf.org/html/rfc7231#section-6.6.1"
}
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tornado-problem-details-0.0.0.tar.gz.
File metadata
- Download URL: tornado-problem-details-0.0.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db6e495a4ac1c3d6375613843327e94f719a43791650cc40d96bb28857167e8f
|
|
| MD5 |
0a41119c6d70b6b3b1f6f5daa6c532eb
|
|
| BLAKE2b-256 |
92f802d2e4592ae97c6f08f20c6b0916fe42d85184a6561239f6f05f13299e43
|
File details
Details for the file tornado_problem_details-0.0.0-py2.py3-none-any.whl.
File metadata
- Download URL: tornado_problem_details-0.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db96768b9fc7108897326072dd6390fbdec0488cbee376ed20abc47a3a0b7010
|
|
| MD5 |
1cbb7074168f83205471e584248b2f0a
|
|
| BLAKE2b-256 |
78ebfc77b2b7b8894eedbd4b3cce7c0ad57e9d17710c8ba3265227f145ac2167
|