Name | exceptionator JSON |
Version |
0.0.1
JSON |
| download |
home_page | |
Summary | The Exceptionator Package |
upload_time | 2023-03-14 06:14:06 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.8,<4.0 |
license | LICENSE.txt |
keywords |
python
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Exceptionator
The `exceptionator` module provides methods for enhancing ordinary python
exceptions with a context which allows for the addition of contextual
information about was was going on when an exception was thrown and what
the contextual state of the code on the stack was.
```{python}
def failing_function():
raise TestError("This is a test error")
class TestEnhancer(unittest.TestCase):
def test_enhance_exception(self):
try:
failing_function()
except TestError as terr:
exceptionator.enhance_exception(terr, "This is some extra content.", "BLAH")
tblines = exceptionator.format_exception(terr)
for line in tblines:
print(line)
return
```
The output of the code above shows an example of how the `enhance_exception` method is
used to add contextual information about the state in which an exception occured.
The `exceptionator` module also allows for control of code output in at different levels
of the stacktrace output. Modules can add a declaration that instructs the `exceptionator`
code on how to output stack trace information for a given module. The select of output policy
is accomplished by applying a policy declaration to each module like so.
```
__traceback_format_policy__ = "Brief"
```
The possible trackback policies are:
```
class TracebackFormatPolicy:
Brief = "Brief"
Full = "Full"
Hide = "Hide"
```
Raw data
{
"_id": null,
"home_page": "",
"name": "exceptionator",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "python",
"author": "",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/56/b5/8b460a767d1df8c6dce5039afda0ef52c08b8d8a7c0e29eb4a04709132a3/exceptionator-0.0.1.tar.gz",
"platform": null,
"description": "# Exceptionator\nThe `exceptionator` module provides methods for enhancing ordinary python\nexceptions with a context which allows for the addition of contextual\ninformation about was was going on when an exception was thrown and what\nthe contextual state of the code on the stack was.\n\n```{python}\n\ndef failing_function():\n raise TestError(\"This is a test error\")\n\nclass TestEnhancer(unittest.TestCase):\n\n def test_enhance_exception(self):\n\n try:\n failing_function()\n except TestError as terr:\n exceptionator.enhance_exception(terr, \"This is some extra content.\", \"BLAH\")\n\n tblines = exceptionator.format_exception(terr)\n\n for line in tblines:\n print(line)\n\n return\n\n```\n\nThe output of the code above shows an example of how the `enhance_exception` method is\nused to add contextual information about the state in which an exception occured.\n\nThe `exceptionator` module also allows for control of code output in at different levels\nof the stacktrace output. Modules can add a declaration that instructs the `exceptionator`\ncode on how to output stack trace information for a given module. The select of output policy\nis accomplished by applying a policy declaration to each module like so.\n\n```\n\n__traceback_format_policy__ = \"Brief\"\n\n\n```\n\nThe possible trackback policies are:\n\n```\nclass TracebackFormatPolicy:\n Brief = \"Brief\"\n Full = \"Full\"\n Hide = \"Hide\"\n```\n\n\n",
"bugtrack_url": null,
"license": "LICENSE.txt",
"summary": "The Exceptionator Package",
"version": "0.0.1",
"split_keywords": [
"python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5f0531b56dd6e85e419da9d3952a3bd0c05562d7dbbc89f297761ebed8f42ab5",
"md5": "257ac4f5e28d153a5ee880bf8c779511",
"sha256": "02fd39c61b150ced5b144e2451c43c59cb31ae96f8152fc9bb0800f3c5c26689"
},
"downloads": -1,
"filename": "exceptionator-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "257ac4f5e28d153a5ee880bf8c779511",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 5596,
"upload_time": "2023-03-14T06:14:04",
"upload_time_iso_8601": "2023-03-14T06:14:04.619084Z",
"url": "https://files.pythonhosted.org/packages/5f/05/31b56dd6e85e419da9d3952a3bd0c05562d7dbbc89f297761ebed8f42ab5/exceptionator-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "56b58b460a767d1df8c6dce5039afda0ef52c08b8d8a7c0e29eb4a04709132a3",
"md5": "96215708ced9b662ed0a74a35a967ba6",
"sha256": "41ee5e5b344f91975f2b3166fe7b77f6dd9767f8e20745e45cdd8f74fd96339b"
},
"downloads": -1,
"filename": "exceptionator-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "96215708ced9b662ed0a74a35a967ba6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 5069,
"upload_time": "2023-03-14T06:14:06",
"upload_time_iso_8601": "2023-03-14T06:14:06.454619Z",
"url": "https://files.pythonhosted.org/packages/56/b5/8b460a767d1df8c6dce5039afda0ef52c08b8d8a7c0e29eb4a04709132a3/exceptionator-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-14 06:14:06",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "exceptionator"
}