WrapErr
The goal of WrapErr is to avoid contaminating main logic with try-catch blocks and the exception handling logic.
Without WrapErr, you have something like this:
try:
// do something
except Exception as e:
// exception handling logic
With WrapErr, you would write something more like this:
def error_handler(e: Exception):
// exception handling logic
@wrap_error(error_handler)
def foo(*args, **kwargs):
// do something
You can reuse the same error handling logic across multiple functions and methods:
def error_handler(e: Exception):
// exception handling logic
@wrap_error(error_handler)
def foo(*args, **kwargs):
// do something
@wrap_error(error_handler):
def bar(*args, **kwargs):
// do something else
You can also only handle exceptions of a specific type:
def value_error_handler(e: ValueError):
// exception handling logic
@wrap_error(error_handler, ValueError)
def foo(*args, **kwargs):
// do something
And you can combine different error handlers that handle different exceptions:
def value_error_handler(e: ValueError):
// exception handling logic
def attribute_error_handler(e: AttributeError):
// more exception handling logic
@wrap_error(value_error_handler, ValueError)
@wrap_error(attribute_error_handler, AttributeError)
def foo(*args, **kwargs):
// do something
Metadata
Release files for wraperr 1.0.2
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 |
|---|---|---|---|---|
| wraperr-1.0.2.tar.gz | 4.5 kB | Without provenance | Details for wraperr-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wraperr-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for wraperr-1.0.2-py3-none-any.whl |
Total release size: 7.5 kB
Release files / wraperr-1.0.2.tar.gz
| Download URL | wraperr-1.0.2.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cc162e55bc080dd789841929923ffc365976d549ea5c3504d88bd9d4ee94107a
|
|
BLAKE2b-256 checksum How to use checksums |
22dcce637d0f00ef16923a55595079891753a68e97471942afb0fb0ea2122c85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
|
Release files / wraperr-1.0.2-py3-none-any.whl
| Download URL | wraperr-1.0.2-py3-none-any.whl |
|---|---|
| Size | 2.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
814fc876111effeb67f018005ca8d20ace886bee22295b90c9012a7a7885a082
|
|
BLAKE2b-256 checksum How to use checksums |
9118cc82623495b04ed93b9ac3ba23de5242c98b3565d11c2698781711e12594
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
|
Security for wraperr 1.0.2
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.