Flask-ReportableError
=====================
Introduction
------------
Flask-ReportableError is a Flask extension for handling errors that can
be reported to the web client.
Documentation
-------------
In order to use Flask-ReportableError, you must include the following
statement in you application start script::
from flask import Flask
import flask_reportable_error
app = Flask(__name__)
app.config.from_envvar('FLASK_SETTINGS', silent=True)
flask_reportable_error.init(app)
API
---
- ``flask_reportable_error.init()``:
context initializer, it must receive the application as parameter.
- ``flask_reportable_error.mixin``:
class decorator that declares the decorated class as mixin with
reportable exceptions.
- ``flask_reportable_error.reportable()``:
factory to create reportable exception classes. For example::
raise reportable(ValueError)('invalid data received')
- ``flask_reportable_error.ReportableErrorMixin``:
mixin for reportable exception classes.
- ``report()``:
method that returns the reportable string – can be overridden.
- ``status_code``:
property representing the numeric status code – can be set at
instance level.
- ``template``:
attribute refering to custom template name.
- ``headers``:
attribute refering to custom headers.
- ``type_name``:
attribute set by ``reportable()`` on inheritance, with the name of
the original exception class.
Settings
--------
The Flask settings may contain the key ``REPORTABLE_ERROR``, that’s a
dictionary with the following keys:
- ``LOGLEVEL``:
the logging level. If not supplied, Flask-ReportableError uses
``logging.ERROR``.
- ``DEFAULT_STATUS_CODE``:
the default numeric status code for reportable exception classes. By
default it’s 500.
- ``TEMPLATE``:
the name of a template to be used instead of none. The context of the
template will contain the exception as value of the ``exc`` key.
- ``HEADERS``:
a dictionary to be used as default headers instead of ``{}``.
Metadata
Release files for Flask-ReportableError 0.4.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Flask-ReportableError-0.4.3.tar.gz | 3.1 kB | Without provenance | Details for Flask-ReportableError-0.4.3.tar.gz |
Release files / Flask-ReportableError-0.4.3.tar.gz
| Download URL | Flask-ReportableError-0.4.3.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d9425cc0481ec067f683097c6b22c7e7c5b566ec993f5d610ac8690e31a02d2
|
|
BLAKE2b-256 checksum How to use checksums |
e0e363e01ae5288f1d599a463fc83a9d8753bffd65bb7d991c21220db741f9ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for Flask-ReportableError 0.4.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.