diegosouzapw/OmniRoute · error

Video contact sheet was aborted

Error message

Video contact sheet was aborted

What it means

Abort sentinel thrown from buildVideoContactSheet when the request signal fires (caller cancel or timeout) during SVG tile rendering/compositing with sharp. It stops sheet generation promptly so no CPU is spent on an abandoned request.

Solutions

  1. Treat as normal cancellation: stop processing and release sharp resources
  2. Verify the abort source — caller cancel vs. contact-sheet timeout too short
  3. Propagate the abort to sibling frame operations instead of continuing
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/lib/guardrails/videoBridgeContactSheet.ts:69 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/e86e5d167bf692d2. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/guardrails/videoBridgeContactSheet.ts:69

}

function buildTimestampLabel(timestampSeconds: number): Buffer {
  const label = formatContactSheetTimestamp(timestampSeconds);
  const labelTop = TILE_SIZE - LABEL_HEIGHT;
  return Buffer.from(
    `<svg xmlns="http://www.w3.org/2000/svg" width="${TILE_SIZE}" height="${TILE_SIZE}" viewBox="0 0 ${TILE_SIZE} ${TILE_SIZE}">
      <rect x="0" y="${labelTop}" width="${TILE_SIZE}" height="${LABEL_HEIGHT}" fill="#000000" fill-opacity="0.82" />
      <text x="${LABEL_PADDING}" y="${labelTop + 42}" fill="#ffffff" font-family="DejaVu Sans Mono, monospace" font-size="${LABEL_FONT_SIZE}" font-weight="700">${label}</text>
    </svg>`
  );
}

/** Build an optional bounded JPEG grid; every failure except abort is fail-safe to individual frames. */
export async function buildVideoContactSheet(
  frames: readonly ContactSheetFrame[],
  options: ContactSheetOptions = {}
): Promise<VideoContactSheetResult> {
  if (options.signal?.aborted) throw new Error("Video contact sheet was aborted");
  if (frames.length < 1 || frames.length > MAX_FRAMES) return fallback(frames);
  if (
    frames.some(
      (frame) =>
        !Number.isFinite(frame.timestampSeconds) || frame.timestampSeconds < 0 || !frame.dataUri
    )
  ) {
    return fallback(frames);
  }
  const columns = Math.min(4, Math.max(1, Math.floor(options.columns ?? 2)), frames.length);
  const rows = Math.ceil(frames.length / columns);
  const controller = new AbortController();
  const timeout = options.timeoutMs
    ? setTimeout(() => controller.abort(), options.timeoutMs)
    : null;
  const signal = options.signal
    ? AbortSignal.any([options.signal, controller.signal])
    : controller.signal;

View on GitHub (pinned to a179ffed5b)