MCPcopy Create free account
hub / github.com/Effect-TS/effect / report

Function report

packages/effect/src/ErrorReporter.ts:139–160  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

137 return {
138 [TypeId]: TypeId,
139 report(options) {
140 if (reported.has(options.cause)) return
141 reported.add(options.cause)
142 for (let i = 0; i < options.cause.reasons.length; i++) {
143 const reason = options.cause.reasons[i]
144 if (reason._tag === "Interrupt") continue
145 const original = reason._tag === "Fail" ? reason.error : reason.defect
146 const isObject = typeof original === "object" && original !== null
147 if (isObject) {
148 if (reported.has(original)) continue
149 reported.add(original)
150 }
151 if (isIgnored(original)) continue
152 const pretty = effect.causePrettyError(original as any, reason.annotations)
153 report({
154 ...options,
155 error: pretty,
156 severity: isObject ? getSeverity(original) : "Info",
157 attributes: isObject ? getAttributes(original) : emptyAttributes
158 })
159 }
160 }
161 }
162}
163

Callers

nothing calls this directly

Calls 5

isIgnoredFunction · 0.85
getSeverityFunction · 0.85
getAttributesFunction · 0.85
addMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected