MCPcopy Create free account
hub / github.com/callstack/agent-device / remapSequenceErrorStepIndex

Function remapSequenceErrorStepIndex

src/core/dispatch-interactions.ts:478–496  ·  view source on GitHub ↗
(error: unknown, stepOffset: number)

Source from the content-addressed store, hash-verified

476// Sequence step errors carry a chunk-local failedStepIndex and completedSteps; rebase both onto the
477// global series so the error names the true step and completed count across chunk boundaries.
478function remapSequenceErrorStepIndex(error: unknown, stepOffset: number): unknown {
479 if (stepOffset === 0 || !(error instanceof AppError) || !error.details) return error;
480 const localIndex = error.details.failedStepIndex;
481 if (typeof localIndex !== 'number') return error;
482 const localCompletedSteps = error.details.completedSteps;
483 return new AppError(
484 error.code,
485 error.message,
486 {
487 ...error.details,
488 failedStepIndex: localIndex + stepOffset,
489 chunkStepIndex: localIndex,
490 ...(typeof localCompletedSteps === 'number'
491 ? { completedSteps: stepOffset + localCompletedSteps }
492 : {}),
493 },
494 error.cause,
495 );
496}
497
498async function runDirectPressSeries(
499 interactor: Interactor,

Callers 1

runIosSequenceChunksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…