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.0.2.tar.gz
(65.5 kB
view hashes)
Built Distribution
Close
Hashes for record_convertor-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 569e09e1bdce72340017b3be3d15d8ef29b033c181fcf83f1e7c01e2bacaec39 |
|
MD5 | bb700c2a53840534774b89b117329e94 |
|
BLAKE2b-256 | 83036e4f0a7b84654191c485fa91de8e82cfeab6f3157449f50a9d15e1c2a6f0 |