@@ -2,7 +2,13 @@ import { SpanKind } from "@opentelemetry/api";
2
2
import { VERSION } from "../../version.js" ;
3
3
import { ApiError , RateLimitError } from "../apiClient/errors.js" ;
4
4
import { ConsoleInterceptor } from "../consoleInterceptor.js" ;
5
- import { InternalError , parseError , sanitizeError , TaskPayloadParsedError } from "../errors.js" ;
5
+ import {
6
+ InternalError ,
7
+ isInternalError ,
8
+ parseError ,
9
+ sanitizeError ,
10
+ TaskPayloadParsedError ,
11
+ } from "../errors.js" ;
6
12
import { runMetadata , TriggerConfig , waitUntil } from "../index.js" ;
7
13
import { recordSpanException , TracingSDK } from "../otel/index.js" ;
8
14
import {
@@ -536,11 +542,13 @@ export class TaskExecutor {
536
542
537
543
if (
538
544
error instanceof Error &&
539
- ( error . name === "AbortTaskRunError" ||
540
- error . name === "TaskPayloadParsedError" ||
541
- ( "skipRetrying" in error && error . skipRetrying === true ) )
545
+ ( error . name === "AbortTaskRunError" || error . name === "TaskPayloadParsedError" )
542
546
) {
543
- return { status : "skipped" , error : error instanceof InternalError ? error : undefined } ;
547
+ return { status : "skipped" } ;
548
+ }
549
+
550
+ if ( isInternalError ( error ) && error . skipRetrying ) {
551
+ return { status : "skipped" , error } ;
544
552
}
545
553
546
554
if ( execution . run . maxAttempts ) {
0 commit comments