MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / withOriginalCause

Function withOriginalCause

packages/react/src/api/error-reporting.tsx:71–74  ·  view source on GitHub ↗
(error: Error, original: unknown)

Source from the content-addressed store, hash-verified

69
70/** Keep the original value reachable without clobbering an existing chain. */
71const withOriginalCause = (error: Error, original: unknown): Error => {
72 if (error.cause === undefined && original !== error) error.cause = original;
73 return error;
74};
75
76const errorFromValue = (value: unknown, context: FrontendErrorContext): Error => {
77 // oxlint-disable-next-line executor/no-error-constructor -- boundary: a crash-reporting transport only understands built-in Errors; this module is the adapter that produces them

Callers 3

errorFromValueFunction · 0.85
errorFromCauseFunction · 0.85
toReportableErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected