# 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",
message="Fire in the server room",
mitigations=[
"Use the fire extinguisher",
"Flood the room with halon gas (Attention: make sure no humans are in the room!)"
],
parameters={}
)
```
### 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
```
## Links and References
For further details check out the [project documentation](https://exasol.github.io/error-reporting-python/).
Raw data
{
"_id": null,
"home_page": "https://github.com/exasol/error-reporting-python",
"name": "exasol-error-reporting",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "exasol, python, error-reporting",
"author": "Umit Buyuksahin",
"author_email": "umit.buyuksahin@exasol.com",
"download_url": "https://files.pythonhosted.org/packages/d4/96/e3369bf1761f6dd633e14b2e6f1625ff90dec50a0873399d49e69b2504a7/exasol_error_reporting-0.5.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 message=\"Fire in the server room\",\n mitigations=[\n \"Use the fire extinguisher\",\n \"Flood the room with halon gas (Attention: make sure no humans are in the room!)\"\n ],\n parameters={}\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\n## Links and References\n\nFor further details check out the [project documentation](https://exasol.github.io/error-reporting-python/).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Exasol Python Error Reporting",
"version": "0.5.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": "62a5d72ff9de442e9ea37bd9141eda5c227982ea009da77dc73ed3aa77e40014",
"md5": "0d96643638833ee9cebed5f82087a975",
"sha256": "17a5e6cd862e79796ae9acd62f7d0dd13c485ad4a4d7467bb7f8d57c1c213d5e"
},
"downloads": -1,
"filename": "exasol_error_reporting-0.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0d96643638833ee9cebed5f82087a975",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 15754,
"upload_time": "2024-10-25T10:42:56",
"upload_time_iso_8601": "2024-10-25T10:42:56.498885Z",
"url": "https://files.pythonhosted.org/packages/62/a5/d72ff9de442e9ea37bd9141eda5c227982ea009da77dc73ed3aa77e40014/exasol_error_reporting-0.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d496e3369bf1761f6dd633e14b2e6f1625ff90dec50a0873399d49e69b2504a7",
"md5": "c438a898c960e9d04a8075a4bb1fa06a",
"sha256": "5051f9a0dc9dbfc2dfa808d6b88c7595fa2688aa11a2b51c0895db00fe3e41bb"
},
"downloads": -1,
"filename": "exasol_error_reporting-0.5.0.tar.gz",
"has_sig": false,
"md5_digest": "c438a898c960e9d04a8075a4bb1fa06a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 12594,
"upload_time": "2024-10-25T10:42:58",
"upload_time_iso_8601": "2024-10-25T10:42:58.119037Z",
"url": "https://files.pythonhosted.org/packages/d4/96/e3369bf1761f6dd633e14b2e6f1625ff90dec50a0873399d49e69b2504a7/exasol_error_reporting-0.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-25 10:42:58",
"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"
}