diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-09-26 14:50:22 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-09-26 15:33:04 +0200 |
| commit | 7e4494256a08f585523e01b1bbc51f41ff4e2b95 (patch) | |
| tree | ccbf873b2bfb11aa22f185e78ce1e2e5eebd094c /wrappers/python/src/error.py | |
| parent | 448c51d2142c186f0490b9d51c0d73beb3c76863 (diff) | |
Refactor: Errors into custom export types and expose types
Diffstat (limited to 'wrappers/python/src/error.py')
| -rw-r--r-- | wrappers/python/src/error.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/wrappers/python/src/error.py b/wrappers/python/src/error.py new file mode 100644 index 0000000..50298bb --- /dev/null +++ b/wrappers/python/src/error.py @@ -0,0 +1,15 @@ +from enum import Enum + +class ErrorLevel(Enum): + ERR_OTHER = 0 + ERR_INFO = 1 + ERR_WARNING = 2 + ERR_FATAL = 3 + +class WrappedError(Exception): + def __init__(self, traceback: str, cause: str, level: ErrorLevel): + super(WrappedError, self).__init__(cause) + self.traceback = traceback + self.cause = cause + self.level = level + |
