MCPcopy Create free account
hub / github.com/effect-app/libs / tryToReport

Function tryToReport

packages/effect-app/src/client/errors.ts:296–310  ·  view source on GitHub ↗
(error: { toReport(): Record<string, unknown>; toString(): string })

Source from the content-addressed store, hash-verified

294}
295
296export const tryToReport = (error: { toReport(): Record<string, unknown>; toString(): string }) => {
297 try {
298 return error.toReport()
299 } catch {
300 try {
301 return { error: error.toString() }
302 } catch (err) {
303 try {
304 return { error: `Failed to convert error: ${err}` }
305 } catch {
306 return { error: `Failed to convert error: unknown failure` }
307 }
308 }
309 }
310}

Callers 4

reportErrorFunction · 0.90
reportSentryFunction · 0.90
reportErrorFunction · 0.90
reportSentryFunction · 0.90

Calls 2

toReportMethod · 0.80
toStringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…