feat(errors): add caller-safe typed error projections

This commit is contained in:
morluto committed 2026-07-13 11:50:49 +00:00
1 parent 9f3639f29f
commit 3be439cbf3
7 files changed
+261 -18

No files matched your search

+5 -3
View File
@@ -9,7 +9,10 @@ import type {
} from "../domain/processCapture.js";
import { validateProcessCapture } from "../domain/processCapture.js";
import { err, ok, type Result } from "../domain/result.js";
import { ProcessCaptureError } from "./ProcessCaptureError.js";
import {
ProcessCaptureError,
processCaptureCancelled,
} from "./ProcessCaptureError.js";
export { ProcessCaptureError } from "./ProcessCaptureError.js";
import { startLoopbackReplay, type LoopbackReplay } from "./LoopbackReplay.js";
@@ -372,8 +375,7 @@ const completeCapture = async (options: {
const { runtime, scenario } = options;
runtime.checkpoints.trigger("root_exit");
const { reason } = options.exit;
if (reason === "cancelled")
throw new ProcessCaptureError("process capture was cancelled");
if (reason === "cancelled") throw processCaptureCancelled();
const settlement = await observeSettlement(
options.runId,
[