# 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
```shell
pip install exasol-error-reporting
```
### Create a Simple Error
```python
from exasol import error
error1 = error.ExaError(
"E-TEST-1", "A trivial error", "No mitigation available", {}
)
```
### Specify Multiple Mitigations
```python
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
```python
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)
```python
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](doc/user_guide/user_guide.md) 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)
```shell
ec parse some-python-file.py
```
```shell
ec parse < some-python-file.py
```
## Generating an error-code data file
In order to generate a [error-code-report](https://schemas.exasol.com/error_code_report-1.0.0.json) compliant data file,
you can use the generate subcommand.
```shell
ec generate NAME VERSION PACKAGE_ROOT > error-codes.json
```
## Known Issues
* [Throws exception on invalid error code format](https://github.com/exasol/error-reporting-python/issues/27)
* [Single mitigations only can be passed within a list](https://github.com/exasol/error-reporting-python/issues/26)
* [Named parameters do not work for error construction](https://github.com/exasol/error-reporting-python/issues/25)
### Information for Users
* [User Guide](doc/user_guide/user_guide.md)
* [Changelog](doc/changes/changelog.md)
You can find corresponding libraries for other languages here:
* [Error reporting Java](https://github.com/exasol/error-reporting-java)
* [Error reporting Lua](https://github.com/exasol/error-reporting-lua)
* [Error reporting Go](https://github.com/exasol/error-reporting-go)
* [Error reporting C#](https://github.com/exasol/error-reporting-csharp)
### Information for Contributors
* [System Requirement Specification](doc/system_requirements.md)
* [Design](doc/design.md)
* [Dependencies](doc/dependencies.md)
Raw data
{
"_id": null,
"home_page": "https://github.com/exasol/error-reporting-python",
"name": "exasol-error-reporting",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "exasol,python,error-reporting",
"author": "Umit Buyuksahin",
"author_email": "umit.buyuksahin@exasol.com",
"download_url": "https://files.pythonhosted.org/packages/3e/0d/a2583b33a5792d3061e76e68277ad05ffb02d9569905dfd54410942b394b/exasol_error_reporting-0.4.0.tar.gz",
"platform": null,
"description": "# Exasol Error Reporting\n\nThis project contains a Python library for describing Exasol error messages.\nThis library lets you define errors with a uniform set of attributes.\nFurthermore, the error message is implemented to be parseable,\nso that you can extract an error catalog from the code.\n\n## In a Nutshell\n\n### Install the library\n\n```shell\npip install exasol-error-reporting\n```\n\n### Create a Simple Error\n\n```python\nfrom exasol import error\n\nerror1 = error.ExaError(\n \"E-TEST-1\", \"A trivial error\", \"No mitigation available\", {}\n)\n```\n\n### Specify Multiple Mitigations\n```python\nfrom exasol import error\n\nerror2 = error.ExaError(\n \"E-TEST-2\",\n \"Fire in the server room\",\n [\n \"Use the fire extinguisher\",\n \"Flood the room with halon gas (Attention: be sure no humans in the room!)\"\n ],\n {}\n)\n```\n\n### Error Parameter(s) without description\n\n```python\nfrom exasol import error\n\nerror3 = error.ExaError(\n \"E-TEST-2\",\n \"Not enough space on device {{device}}.\",\n \"Delete something from {{device}}.\",\n {\"device\": \"/dev/sda1\"},\n)\n```\n### Error with detailed Parameter(s) \n\n```python\nfrom exasol import error\nfrom exasol.error import Parameter\n\nerror4 = error.ExaError(\n \"E-TEST-2\",\n \"Not enough space on device {{device}}.\",\n \"Delete something from {{device}}.\",\n {\"device\": Parameter(\"/dev/sda1\", \"name of the device\")},\n)\n```\n\nCheck out the [user guide](doc/user_guide/user_guide.md) for more details.\n\n## Tooling\n\nThe `exasol-error-reporting` library comes with a command line tool (`ec`) which also can be invoked\nby using its package/module entry point (`python -m exasol.error`).\nFor detailed information about the usage consider consulting the help `ec --help` or `python -m exasol.error --help`.\n\n### Parsing the error definitions in a python file(s)\n\n```shell\nec parse some-python-file.py \n```\n\n```shell\nec parse < some-python-file.py \n```\n\n## Generating an error-code data file\n\nIn order to generate a [error-code-report](https://schemas.exasol.com/error_code_report-1.0.0.json) compliant data file,\nyou can use the generate subcommand.\n\n```shell\nec generate NAME VERSION PACKAGE_ROOT > error-codes.json\n```\n\n## Known Issues\n\n* [Throws exception on invalid error code format](https://github.com/exasol/error-reporting-python/issues/27)\n* [Single mitigations only can be passed within a list](https://github.com/exasol/error-reporting-python/issues/26)\n* [Named parameters do not work for error construction](https://github.com/exasol/error-reporting-python/issues/25)\n\n### Information for Users\n\n* [User Guide](doc/user_guide/user_guide.md)\n* [Changelog](doc/changes/changelog.md)\n\nYou can find corresponding libraries for other languages here:\n\n* [Error reporting Java](https://github.com/exasol/error-reporting-java)\n* [Error reporting Lua](https://github.com/exasol/error-reporting-lua)\n* [Error reporting Go](https://github.com/exasol/error-reporting-go)\n* [Error reporting C#](https://github.com/exasol/error-reporting-csharp)\n\n### Information for Contributors\n\n* [System Requirement Specification](doc/system_requirements.md)\n* [Design](doc/design.md)\n* [Dependencies](doc/dependencies.md)",
"bugtrack_url": null,
"license": "MIT",
"summary": "Exasol Python Error Reporting",
"version": "0.4.0",
"project_urls": {
"Homepage": "https://github.com/exasol/error-reporting-python",
"Repository": "https://github.com/exasol/error-reporting-python"
},
"split_keywords": [
"exasol",
"python",
"error-reporting"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "093f71308fb79e9add5e19c58160b01550781d1c5ab10fe4b9fd39894dcbfe96",
"md5": "8d67415b61c58f73d4ed3345e9f4676b",
"sha256": "851aed9fd95bc3c6a566ba174a8052897442bfe503c9b8858faab26e3d6f0153"
},
"downloads": -1,
"filename": "exasol_error_reporting-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8d67415b61c58f73d4ed3345e9f4676b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 14875,
"upload_time": "2023-09-27T08:21:03",
"upload_time_iso_8601": "2023-09-27T08:21:03.222075Z",
"url": "https://files.pythonhosted.org/packages/09/3f/71308fb79e9add5e19c58160b01550781d1c5ab10fe4b9fd39894dcbfe96/exasol_error_reporting-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3e0da2583b33a5792d3061e76e68277ad05ffb02d9569905dfd54410942b394b",
"md5": "046c60752049256d6d71922dd2ce425b",
"sha256": "a0bc5056aa23df97eb47d2da95d112d9b2dcd5295016fdefac2fc7aa5e7eea19"
},
"downloads": -1,
"filename": "exasol_error_reporting-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "046c60752049256d6d71922dd2ce425b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 11361,
"upload_time": "2023-09-27T08:21:04",
"upload_time_iso_8601": "2023-09-27T08:21:04.796412Z",
"url": "https://files.pythonhosted.org/packages/3e/0d/a2583b33a5792d3061e76e68277ad05ffb02d9569905dfd54410942b394b/exasol_error_reporting-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-27 08:21:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "exasol",
"github_project": "error-reporting-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "exasol-error-reporting"
}