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
Close
Hashes for tornado-problem-details-0.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | db6e495a4ac1c3d6375613843327e94f719a43791650cc40d96bb28857167e8f |
|
MD5 | 0a41119c6d70b6b3b1f6f5daa6c532eb |
|
BLAKE2b-256 | 92f802d2e4592ae97c6f08f20c6b0916fe42d85184a6561239f6f05f13299e43 |
Close
Hashes for tornado_problem_details-0.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db96768b9fc7108897326072dd6390fbdec0488cbee376ed20abc47a3a0b7010 |
|
MD5 | 1cbb7074168f83205471e584248b2f0a |
|
BLAKE2b-256 | 78ebfc77b2b7b8894eedbd4b3cce7c0ad57e9d17710c8ba3265227f145ac2167 |