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

Function errorFromValue

packages/react/src/api/error-reporting.tsx:76–81  ·  view source on GitHub ↗
(value: unknown, context: FrontendErrorContext)

Source from the content-addressed store, hash-verified

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
78 const error = new Error(describeUnknown(value, context));
79 error.name = nameFromUnknown(value, context.surface);
80 return withOriginalCause(error, value);
81};
82
83const errorFromCause = (cause: Cause.Cause<unknown>, context: FrontendErrorContext): Error => {
84 // `prettyErrors` is the non-lossy conversion: it renders every reason —

Callers 2

errorFromCauseFunction · 0.85
toReportableErrorFunction · 0.85

Calls 3

describeUnknownFunction · 0.85
nameFromUnknownFunction · 0.85
withOriginalCauseFunction · 0.85

Tested by

no test coverage detected