Exasol Python Error Reporting
Project description
Exasol Error Reporting
This project contains a Python library for describing Exasol error messages. This library lets you define errors with a uniform set of attributes. Furthermore, the error message is implemented to be parseable, so that you can extract an error catalog from the code.
In a Nutshell
Install the library
pip install exasol-error-reporting
Create a Simple Error
from exasol import error
error1 = error.ExaError(
"E-TEST-1", "A trivial error", "No mitigation available", {}
)
Specify Multiple Mitigations
from exasol import error
error2 = error.ExaError(
"E-TEST-2",
"Fire in the server room",
[
"Use the fire extinguisher",
"Flood the room with halon gas (Attention: be sure no humans in the room!)"
],
{}
)
Error Parameter(s) without description
from exasol import error
error3 = error.ExaError(
"E-TEST-2",
"Not enough space on device {{device}}.",
"Delete something from {{device}}.",
{"device": "/dev/sda1"},
)
Error with detailed Parameter(s)
from exasol import error
from exasol.error import Parameter
error4 = error.ExaError(
"E-TEST-2",
"Not enough space on device {{device}}.",
"Delete something from {{device}}.",
{"device": Parameter("/dev/sda1", "name of the device")},
)
Check out the user guide for more details.
Tooling
The exasol-error-reporting
library comes with a command line tool (ec
) which also can be invoked
by using its package/module entry point (python -m exasol.error
).
For detailed information about the usage consider consulting the help ec --help
or python -m exasol.error --help
.
Parsing the error definitions in a python file(s)
ec parse some-python-file.py
ec parse < some-python-file.py
Generating an error-code data file
In order to generate a error-code-report compliant data file, you can use the generate subcommand.
ec generate NAME VERSION PACKAGE_ROOT > error-codes.json
Known Issues
- Throws exception on invalid error code format
- Single mitigations only can be passed within a list
- Named parameters do not work for error construction
Information for Users
You can find corresponding libraries for other languages here:
Information for Contributors
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
Built Distribution
Hashes for exasol_error_reporting-0.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0bc5056aa23df97eb47d2da95d112d9b2dcd5295016fdefac2fc7aa5e7eea19 |
|
MD5 | 046c60752049256d6d71922dd2ce425b |
|
BLAKE2b-256 | 3e0da2583b33a5792d3061e76e68277ad05ffb02d9569905dfd54410942b394b |
Hashes for exasol_error_reporting-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 851aed9fd95bc3c6a566ba174a8052897442bfe503c9b8858faab26e3d6f0153 |
|
MD5 | 8d67415b61c58f73d4ed3345e9f4676b |
|
BLAKE2b-256 | 093f71308fb79e9add5e19c58160b01550781d1c5ab10fe4b9fd39894dcbfe96 |