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.1.tar.gz
(65.5 kB
view hashes)
Built Distribution
Close
Hashes for record_convertor-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa04f791cd9bbcabcbd9a5e22fd53ce443934e32815dd7f5184501eb7c1cb625 |
|
MD5 | 3cf0b49d4c5dea2c2d76b08e7d119d0d |
|
BLAKE2b-256 | df88d50a7f28faeb823e99493a1368ec6862651475d89b487fa2036205975858 |