(cause: unknown)
| 4344 | return Effect.gen(function* () { |
| 4345 | // oxlint-disable executor/no-instanceof-error, executor/no-unknown-error-message, executor/no-manual-tag-check -- boundary: normalize arbitrary unknown plugin failures into a human-readable message for ToolInvocationError/telemetry |
| 4346 | const formatInvocationCauseMessage = (cause: unknown): string => { |
| 4347 | if (cause instanceof Error && cause.message.length > 0) return cause.message; |
| 4348 | // Non-Error / empty-message causes: `String(plainObject)` renders |
| 4349 | // "[object Object]", which is what telemetry then shows as the only |
| 4350 | // label for the failure. Prefer the tag, else stringify structurally. |
| 4351 | if (typeof cause === "object" && cause !== null) { |
| 4352 | const tag = (cause as { readonly _tag?: unknown })._tag; |
| 4353 | if (typeof tag === "string") return tag; |
| 4354 | return Inspectable.toStringUnknown(cause, 0); |
| 4355 | } |
| 4356 | return String(cause); |
| 4357 | }; |
| 4358 | // oxlint-enable executor/no-instanceof-error, executor/no-unknown-error-message, executor/no-manual-tag-check |
| 4359 | const wrapInvocationError = <A, E>( |
| 4360 | effect: Effect.Effect<A, E>, |
no outgoing calls
no test coverage detected