From 7e4494256a08f585523e01b1bbc51f41ff4e2b95 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Mon, 26 Sep 2022 14:50:22 +0200 Subject: Refactor: Errors into custom export types and expose types --- wrappers/python/src/error.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 wrappers/python/src/error.py (limited to 'wrappers/python/src/error.py') 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 + -- cgit v1.2.3