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
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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1aba800157f1b79d84391015697889b9b67ea21a23633d8374ea90915625d50a |
|
MD5 | a1f95cb100b361a09449d3499d315c15 |
|
BLAKE2b-256 | 244937b0d4986cf9ed750929fd53d78ad3f430ca4bd4e2c1a352ca8297a52bb5 |
Close
Hashes for tornado_problem_details-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e941a4be6ded8f349d5787e34fdd1a7709a38b843cd33a94a5817c0c1e3f0046 |
|
MD5 | 488ad29294369c5e87e978673465ec2a |
|
BLAKE2b-256 | 201571804c0429c1be3fe0190a667d20da1a841526dac75c0e96938fc488a631 |