Skip to content

Commit 012e32a

Browse files
committed
fix: unwrap PreviewOperationError cause in timeline failure messages
The refactored finalizeControlAction was recording the generic PreviewOperationError.message (e.g. 'Desktop preview operation failed: click.Input.dispatchMouseEvent (tab ...)') instead of the underlying cause's message. Restore the cause-unwrapping logic so the timeline captures the specific CDP/system error from PreviewOperationError.cause.
1 parent d784409 commit 012e32a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apps/desktop/src/preview/Manager.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,11 +851,13 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function
851851
} else {
852852
const error = Option.getOrNull(Cause.findErrorOption(exit.cause));
853853
const interrupted = isPreviewAutomationControlInterruptedError(error);
854+
const underlying =
855+
isPreviewOperationError(error) && error.cause instanceof Error ? error.cause : error;
854856
yield* replaceAction(tabId, {
855857
...actionEvent,
856858
status: interrupted ? "interrupted" : "failed",
857859
completedAt,
858-
error: error instanceof Error ? error.message : String(error),
860+
error: underlying instanceof Error ? underlying.message : String(underlying),
859861
});
860862
}
861863
const tabs = yield* SynchronizedRef.get(tabsRef);
@@ -2520,6 +2522,7 @@ export const PreviewManagerError = Schema.Union([
25202522
export type PreviewManagerError = typeof PreviewManagerError.Type;
25212523

25222524
export const isPreviewManagerError = Schema.is(PreviewManagerError);
2525+
export const isPreviewOperationError = Schema.is(PreviewOperationError);
25232526
export const isPreviewAutomationControlInterruptedError = Schema.is(
25242527
PreviewAutomationControlInterruptedError,
25252528
);

0 commit comments

Comments
 (0)