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.1.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.1-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file error_manager-1.5.1.tar.gz.

File metadata

  • Download URL: error_manager-1.5.1.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.1.tar.gz
Algorithm Hash digest
SHA256 93bba0c416c192469cbeb2878ff73bda8045c7c5d10f34afb6430cb963d268b6
MD5 eab61e46449b1caac010584334e5c222
BLAKE2b-256 9ebdf1bff19ff04049291b01fecfba50fd64512368da57292bd280ef18f16fef

See more details on using hashes here.

Provenance

The following attestation bundles were made for error_manager-1.5.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: error_manager-1.5.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 84144993ed56a8ba7800c00e9f207fb7da888b762b6b6d111c5649a6fc1bd854
MD5 5791a4a0c4e9b137756f4b4fa4cd033d
BLAKE2b-256 8d47db78cd56d796203a55f9ffb18755b36ccc004a21f0e9a5cdf6aec5ea45fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for error_manager-1.5.1-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