Manage error codes, descriptions and data in a unified way throughout a project
Project description
Managing error codes throughout you project
Error-manager is a simple library for Python to manage all your projects error codes.
docs |
|
|---|---|
tests |
|
package |
error-manager main use cases
Main use case for the error-manager package is to implement a ListErrors class that can be used throughout your project to define and access immutable standard error codes and descriptions
# retrieve customer defined ErrorCode object form ``ListErrors`` class
>>> from errors.error import ListErrors
>>> ListErrors.API_GET_RETURNED_404
ErrorCode(
code='ER_API404_00001',
description='API get request returned 404',
error_data={})
# add custom error data to error message when you want to persist or log the error
# As the errorcode are immutable the add_error_data returns a new error (immutable) error code.
>>> from errors.base import add_error_data
>>> error_without_data = ListErrors.API_GET_RETURNED_404
>>> error_with_data = add_error_data(error_without_data, {'url': 'www.bad_url.com'})
>>> error_with_data
ErrorCode(
code='ER_API404_00001',
description='API get request returned 404',
error_data={'url': 'www.bad_url.com'})
This ErrorCode could be returned by the method performing the request so that the logic calling this method is aware of the failing request.
In order to use a single type as return value the error-manager package introduces a ReturnValue class that can hold the actual response, any possible downstream errors and the status of the return value. See ReturnValue documentation.
Documentation
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 error_manager-1.5.0.tar.gz.
File metadata
- Download URL: error_manager-1.5.0.tar.gz
- Upload date:
- Size: 31.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ae6c0d900dfe60783806b86f13ce9a04c6900b6a5a91f213abaa48b0734f162
|
|
| MD5 |
c2efc8dd1c915054e3028d4ebf3cfa77
|
|
| BLAKE2b-256 |
de4dd5fd8ab2cad4328d491a3bf50f0f11020b1561b9d1b6ecb404204c6054bf
|
Provenance
The following attestation bundles were made for error_manager-1.5.0.tar.gz:
Publisher:
main.yml on OlivettaDataGarden/errors
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
error_manager-1.5.0.tar.gz -
Subject digest:
3ae6c0d900dfe60783806b86f13ce9a04c6900b6a5a91f213abaa48b0734f162 - Sigstore transparency entry: 955803419
- Sigstore integration time:
-
Permalink:
OlivettaDataGarden/errors@82a001be3f5bd31bc2c1fb8df6624df961e6e19d -
Branch / Tag:
refs/tags/v1.5.0 - Owner: https://github.com/OlivettaDataGarden
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@82a001be3f5bd31bc2c1fb8df6624df961e6e19d -
Trigger Event:
push
-
Statement type:
File details
Details for the file error_manager-1.5.0-py3-none-any.whl.
File metadata
- Download URL: error_manager-1.5.0-py3-none-any.whl
- Upload date:
- Size: 22.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40a0a9ecf70fdc812e47280ae650babdfbc4c9ab562ca8cf11ae0d86a649cdb3
|
|
| MD5 |
5ddec5eda1f5e7a4af91eec376eae938
|
|
| BLAKE2b-256 |
5c52a76af3eda26fc1c118f90f379da99762a28d20eb66c056aeaa873dae7aa7
|
Provenance
The following attestation bundles were made for error_manager-1.5.0-py3-none-any.whl:
Publisher:
main.yml on OlivettaDataGarden/errors
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
error_manager-1.5.0-py3-none-any.whl -
Subject digest:
40a0a9ecf70fdc812e47280ae650babdfbc4c9ab562ca8cf11ae0d86a649cdb3 - Sigstore transparency entry: 955803424
- Sigstore integration time:
-
Permalink:
OlivettaDataGarden/errors@82a001be3f5bd31bc2c1fb8df6624df961e6e19d -
Branch / Tag:
refs/tags/v1.5.0 - Owner: https://github.com/OlivettaDataGarden
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@82a001be3f5bd31bc2c1fb8df6624df961e6e19d -
Trigger Event:
push
-
Statement type: