Converts structure, keys and fields from a record according to predefined rules
Project description
A lightweight implementation of a manager for error messages throughout your project. Allows you to easily define and register error codes and messages. Enable easy access to a single list of registerd error codes and messages throughout your project.
docs |
|
---|---|
tests |
|
package |
Free software: GNU Lesser General Public License v3 or later (LGPLv3+)
Installation
pip install error-manager
You can also install the in-development version with:
pip install https://github.com/MaartendeRuyter/errors/archive/master.zip
Main usecases
Error manager provides you with a ListErrors class to retrieve your custom error codes and descriptions throughout your project:
# retrieve customer defined ErrorCode object form ``ListErrors`` class >>> from errors import ListErrors >>> error = ListErrors.COULD_NOT_FIND_ERROR_CODE >>> error ErrorCode(code='ER_GETERROR_00001', description='Could not find requested error code', error_data=<class 'dict'>) # add custom error data to error message when you want to persist or log # the error >>> from errors import add_error_data >>> error_with_data = add_error_data(error, {'key': 'Example error data'}) >>> error_with_data ErrorCode(code='ER_GETERROR_00001', description='Could not find requested error code', error_data={'key': 'Example error data'})
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
record_convertor-1.1.5.tar.gz
(65.0 kB
view hashes)
Built Distribution
Close
Hashes for record_convertor-1.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67a4241a0e54461e1ac3eac4287615525109b7ad506ef78e9d03c4992c0f228f |
|
MD5 | 369348168b9aef0e3da3aca614c34743 |
|
BLAKE2b-256 | 3918c4dbe52ec2f7b0d16986555d2813f80e15f84d8cc3c5eee6b47b299b9152 |