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-0.0.1.tar.gz
(65.4 kB
view hashes)
Built Distribution
Close
Hashes for record_convertor-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 738000f359299fe44391719a472eace8d19409ffa25cf4c6bbfb74b9e28cf581 |
|
MD5 | 5e970041286ff2309a6300b7e8ef96cc |
|
BLAKE2b-256 | 83a41879463f2e3a5835cd3e61381da004d30f357b480f6720c9e0e8bb7b7820 |