File tree Expand file tree Collapse file tree 2 files changed +25
-4
lines changed
internal-packages/run-engine/src/engine/systems Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -270,11 +270,25 @@ export class CheckpointSystem {
270270 const snapshot = await getLatestExecutionSnapshot ( prisma , runId ) ;
271271
272272 if ( snapshot . id !== snapshotId ) {
273- throw new ServiceValidationError ( "Snapshot ID doesn't match the latest snapshot" , 400 ) ;
273+ throw new ServiceValidationError (
274+ "Snapshot ID doesn't match the latest snapshot in continueRunExecution" ,
275+ 400 ,
276+ {
277+ snapshotId,
278+ latestSnapshotId : snapshot . id ,
279+ }
280+ ) ;
274281 }
275282
276283 if ( ! isPendingExecuting ( snapshot . executionStatus ) ) {
277- throw new ServiceValidationError ( "Snapshot is not in a valid state to continue" , 400 ) ;
284+ throw new ServiceValidationError (
285+ "Snapshot is not in a valid state to continue in continueRunExecution" ,
286+ 400 ,
287+ {
288+ snapshotId,
289+ snapshotStatus : snapshot . executionStatus ,
290+ }
291+ ) ;
278292 }
279293
280294 // Get the run and update the status
Original file line number Diff line number Diff line change @@ -318,9 +318,16 @@ export class RunAttemptSystem {
318318 //if there is a big delay between the snapshot and the attempt, the snapshot might have changed
319319 //we just want to log because elsewhere it should have been put back into a state where it can be attempted
320320 this . $ . logger . warn (
321- "RunEngine.createRunAttempt(): snapshot has changed since the attempt was created, ignoring."
321+ "RunEngine.createRunAttempt(): snapshot has changed since the attempt was created, ignoring." ,
322+ {
323+ snapshotId,
324+ latestSnapshotId : latestSnapshot . id ,
325+ }
322326 ) ;
323- throw new ServiceValidationError ( "Snapshot changed" , 409 ) ;
327+ throw new ServiceValidationError ( "Snapshot changed inside startRunAttempt" , 409 , {
328+ snapshotId,
329+ latestSnapshotId : latestSnapshot . id ,
330+ } ) ;
324331 }
325332
326333 const taskRun = await prisma . taskRun . findFirst ( {
You can’t perform that action at this time.
0 commit comments