File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ export const TaskRunErrorCodes = {
9898 DISK_SPACE_EXCEEDED : "DISK_SPACE_EXCEEDED" ,
9999 POD_EVICTED : "POD_EVICTED" ,
100100 POD_UNKNOWN_ERROR : "POD_UNKNOWN_ERROR" ,
101+ IMPORT_PAYLOAD_ERROR : "IMPORT_PAYLOAD_ERROR" ,
101102} as const ;
102103
103104export const TaskRunInternalError = z . object ( {
@@ -124,6 +125,7 @@ export const TaskRunInternalError = z.object({
124125 "DISK_SPACE_EXCEEDED" ,
125126 "POD_EVICTED" ,
126127 "POD_UNKNOWN_ERROR" ,
128+ "IMPORT_PAYLOAD_ERROR" ,
127129 ] ) ,
128130 message : z . string ( ) . optional ( ) ,
129131 stackTrace : z . string ( ) . optional ( ) ,
Original file line number Diff line number Diff line change @@ -92,9 +92,28 @@ export class TaskExecutor {
9292
9393 try {
9494 const payloadPacket = await conditionallyImportPacket ( originalPacket , this . _tracer ) ;
95-
9695 parsedPayload = await parsePacket ( payloadPacket ) ;
96+ } catch ( packetError ) {
97+ recordSpanException ( span , packetError ) ;
98+
99+ return {
100+ ok : false ,
101+ id : execution . run . id ,
102+ error : {
103+ type : "INTERNAL_ERROR" ,
104+ code : TaskRunErrorCodes . IMPORT_PAYLOAD_ERROR ,
105+ message :
106+ packetError instanceof Error
107+ ? `${ packetError . name } : ${ packetError . message } `
108+ : typeof packetError === "string"
109+ ? packetError
110+ : undefined ,
111+ stackTrace : packetError instanceof Error ? packetError . stack : undefined ,
112+ } ,
113+ } satisfies TaskRunExecutionResult ;
114+ }
97115
116+ try {
98117 if ( execution . attempt . number === 1 ) {
99118 await this . #callOnStartFunctions( parsedPayload , ctx , signal ) ;
100119 }
You can’t perform that action at this time.
0 commit comments