File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -149,11 +149,7 @@ export type HandleErrorArgs = {
149
149
signal ?: AbortSignal ;
150
150
} ;
151
151
152
- export type HandleErrorFunction = (
153
- payload : any ,
154
- error : unknown ,
155
- params : HandleErrorArgs
156
- ) => HandleErrorResult ;
152
+ export type HandleErrorFunction = AnyOnCatchErrorHookFunction ;
157
153
158
154
type CommonTaskOptions <
159
155
TIdentifier extends string ,
Original file line number Diff line number Diff line change @@ -1036,11 +1036,17 @@ export class TaskExecutor {
1036
1036
return { status : "skipped" } ;
1037
1037
}
1038
1038
1039
+ const taskCatchErrorHook = lifecycleHooks . getTaskCatchErrorHook ( this . task . id ) ;
1040
+ const globalCatchErrorHooks = lifecycleHooks . getGlobalCatchErrorHooks ( ) ;
1041
+
1042
+ if ( globalCatchErrorHooks . length === 0 && ! taskCatchErrorHook ) {
1043
+ return { status : "noop" } ;
1044
+ }
1045
+
1039
1046
return this . _tracer . startActiveSpan (
1040
1047
"catchError" ,
1041
1048
async ( span ) => {
1042
1049
// Try task-specific catch error hook first
1043
- const taskCatchErrorHook = lifecycleHooks . getTaskCatchErrorHook ( this . task . id ) ;
1044
1050
if ( taskCatchErrorHook ) {
1045
1051
const result = await taskCatchErrorHook ( {
1046
1052
payload,
@@ -1060,7 +1066,6 @@ export class TaskExecutor {
1060
1066
}
1061
1067
1062
1068
// Try global catch error hooks in order
1063
- const globalCatchErrorHooks = lifecycleHooks . getGlobalCatchErrorHooks ( ) ;
1064
1069
for ( const hook of globalCatchErrorHooks ) {
1065
1070
const result = await hook . fn ( {
1066
1071
payload,
You can’t perform that action at this time.
0 commit comments