Metadata-Version: 2.3
Name: exception-tools-abm
Version: 1.0.79347
Summary: Tools and components to work with exceptions
License: Proprietary. All rights reserved. Confidential and belonging to ABM.
Author: mike
Author-email: m.orlov@technokert.ru
Requires-Python: >=3.11,<4.0
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: taskipy (>=1.14.1,<2.0.0)
Description-Content-Type: text/markdown

## Exception tools
Tools and components to work with exceptions

### Examples:

```python
from typing import Any
from exception_tools import raise_if, raise_if_not, repr_exception

def do_the_thing(val: int | Any) -> None:
    raise_if_not(isinstance(val, int), TypeError(f'Required type int, got {type(val).__qualname__}'))
    raise_if(val <= 0, ValueError, 'Only positive values allowed, got', val)
    # actual work

try:
    do_the_thing(None)
except TypeError as e:
    assert repr_exception(e) == "TypeError: Required type int, got NoneType"
    
try:
    do_the_thing(0)
except ValueError as e:
    assert repr_exception(e) == "ValueError: ('Only positive values allowed, got', 0)"
```
