2222
2323from .__types import DictData
2424from .errors import (
25+ BaseError ,
2526 ErrorData ,
2627 JobCancelError ,
27- JobError ,
2828 JobSkipError ,
2929 ResultError ,
3030 StageCancelError ,
31- StageError ,
3231 StageNestedCancelError ,
33- StageNestedError ,
3432 StageNestedSkipError ,
3533 StageSkipError ,
3634 WorkflowCancelError ,
37- WorkflowError ,
35+ WorkflowSkipError ,
3836)
3937from .traces import Trace , get_trace
4038from .utils import default_gen_id
@@ -111,11 +109,11 @@ def validate_statuses(statuses: list[Status]) -> Status:
111109 Status: Final consolidated status based on workflow logic
112110
113111 Example:
114- >>> # Mixed statuses - FAILED takes priority
112+ Case: Mixed statuses - FAILED takes priority
115113 >>> validate_statuses([SUCCESS, FAILED, SUCCESS])
116114 >>> # Returns: FAILED
117115
118- >>> # All same status
116+ Case: All same status
119117 >>> validate_statuses([SUCCESS, SUCCESS, SUCCESS])
120118 >>> # Returns: SUCCESS
121119 """
@@ -132,21 +130,7 @@ def validate_statuses(statuses: list[Status]) -> Status:
132130
133131
134132def get_status_from_error (
135- error : Union [
136- StageError ,
137- StageCancelError ,
138- StageSkipError ,
139- StageNestedCancelError ,
140- StageNestedError ,
141- StageNestedSkipError ,
142- JobError ,
143- JobCancelError ,
144- JobSkipError ,
145- WorkflowError ,
146- WorkflowCancelError ,
147- Exception ,
148- BaseException ,
149- ]
133+ error : Union [BaseError , Exception , BaseException ]
150134) -> Status :
151135 """Get the Status from the error object.
152136
@@ -156,7 +140,10 @@ def get_status_from_error(
156140 Returns:
157141 Status: The status from the specific exception class.
158142 """
159- if isinstance (error , (StageNestedSkipError , StageSkipError , JobSkipError )):
143+ if isinstance (
144+ error ,
145+ (StageNestedSkipError , StageSkipError , JobSkipError , WorkflowSkipError ),
146+ ):
160147 return SKIP
161148 elif isinstance (
162149 error ,
0 commit comments