From 523c6c50d9b27176babd3c5269e9943b8fa31d76 Mon Sep 17 00:00:00 2001 From: alclark Date: Wed, 3 Jun 2026 16:44:08 +0200 Subject: [PATCH 1/3] adding ewoks task exceptions --- src/ewoksutils/exceptions.py | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/ewoksutils/exceptions.py diff --git a/src/ewoksutils/exceptions.py b/src/ewoksutils/exceptions.py new file mode 100644 index 0000000..8c0e357 --- /dev/null +++ b/src/ewoksutils/exceptions.py @@ -0,0 +1,43 @@ +"""Task-related exceptions for the Ewoks ecosystem.""" + +__all__ = ["TaskError", "TaskExecutionError", "TaskInputError"] + + +class TaskError(Exception): + """Base exception for all task-related errors. + + This exception should not be raised directly. Use one of the + more specific exceptions below. + """ + + pass + + +class TaskExecutionError(TaskError, RuntimeError): + """Raised when a task fails during execution. + + This exception is raised when the task's ``run()`` method or + any code executed during task processing raises an exception. + + Multiple inheritance from ``RuntimeError`` ensures backward + compatibility with code that catches ``RuntimeError`` during + task execution. + """ + + pass + + +class TaskInputError(TaskError, ValueError): + """Raised when task inputs are invalid or missing. + + This exception is raised when: + - Required inputs are missing + - Input values fail validation + - Input types are incorrect + + Multiple inheritance from ``ValueError`` ensures backward + compatibility with code that catches ``ValueError`` during + task instantiation. + """ + + pass From 47d84382175d46758411f5193299f7d0da76f087 Mon Sep 17 00:00:00 2001 From: alclark Date: Thu, 4 Jun 2026 17:51:05 +0200 Subject: [PATCH 2/3] cleaning up exceptions text --- src/ewoksutils/exceptions.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/ewoksutils/exceptions.py b/src/ewoksutils/exceptions.py index 8c0e357..09b94c6 100644 --- a/src/ewoksutils/exceptions.py +++ b/src/ewoksutils/exceptions.py @@ -1,6 +1,4 @@ -"""Task-related exceptions for the Ewoks ecosystem.""" - -__all__ = ["TaskError", "TaskExecutionError", "TaskInputError"] +"""Task-related exceptions.""" class TaskError(Exception): @@ -16,11 +14,11 @@ class TaskError(Exception): class TaskExecutionError(TaskError, RuntimeError): """Raised when a task fails during execution. - This exception is raised when the task's ``run()`` method or + This exception is raised when the task's `run()` method or any code executed during task processing raises an exception. - Multiple inheritance from ``RuntimeError`` ensures backward - compatibility with code that catches ``RuntimeError`` during + Multiple inheritance from `RuntimeError` ensures backward + compatibility with code that catches `RuntimeError` during task execution. """ @@ -35,8 +33,8 @@ class TaskInputError(TaskError, ValueError): - Input values fail validation - Input types are incorrect - Multiple inheritance from ``ValueError`` ensures backward - compatibility with code that catches ``ValueError`` during + Multiple inheritance from `ValueError` ensures backward + compatibility with code that catches `ValueError` during task instantiation. """ From f20685e2cf4fa19e6e3ee37598f16a7b60f3f64c Mon Sep 17 00:00:00 2001 From: alclark Date: Fri, 5 Jun 2026 17:42:36 +0200 Subject: [PATCH 3/3] adding TaskWarning and TaskInputWarning to exceptions --- src/ewoksutils/exceptions.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/ewoksutils/exceptions.py b/src/ewoksutils/exceptions.py index 09b94c6..6ecf3f7 100644 --- a/src/ewoksutils/exceptions.py +++ b/src/ewoksutils/exceptions.py @@ -39,3 +39,28 @@ class TaskInputError(TaskError, ValueError): """ pass + + +class TaskWarning(UserWarning): + """Base warning for all task-related warnings. + + This warning should not be raised directly. Use one of the + more specific warnings below. + """ + + pass + + +class TaskInputWarning(TaskWarning): + """Raised when task inputs have issues that do not prevent execution. + + This warning is raised when: + - Input values are deprecated + - Input types will change in future versions + - Input values have non-critical issues + + Inherits from `TaskWarning` to allow catching all task-related + warnings together. + """ + + pass