Skip to main content

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

Documentation Status

tests

Coverage Status

package

PyPI Package latest release Commits since latest release

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

https://errors.readthedocs.io/

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

error_manager-1.5.0.tar.gz (31.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

error_manager-1.5.0-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

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

Hashes for error_manager-1.5.0.tar.gz
Algorithm Hash digest
SHA256 3ae6c0d900dfe60783806b86f13ce9a04c6900b6a5a91f213abaa48b0734f162
MD5 c2efc8dd1c915054e3028d4ebf3cfa77
BLAKE2b-256 de4dd5fd8ab2cad4328d491a3bf50f0f11020b1561b9d1b6ecb404204c6054bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for error_manager-1.5.0.tar.gz:

Publisher: main.yml on OlivettaDataGarden/errors

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for error_manager-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40a0a9ecf70fdc812e47280ae650babdfbc4c9ab562ca8cf11ae0d86a649cdb3
MD5 5ddec5eda1f5e7a4af91eec376eae938
BLAKE2b-256 5c52a76af3eda26fc1c118f90f379da99762a28d20eb66c056aeaa873dae7aa7

See more details on using hashes here.

Provenance

The following attestation bundles were made for error_manager-1.5.0-py3-none-any.whl:

Publisher: main.yml on OlivettaDataGarden/errors

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page