(self: Cause.Cause<E>)
| 297 | |
| 298 | /** @internal */ |
| 299 | export const causeSquash = <E>(self: Cause.Cause<E>): unknown => { |
| 300 | const partitioned = causePartition(self) |
| 301 | if (partitioned.Fail.length > 0) { |
| 302 | return partitioned.Fail[0].error |
| 303 | } else if (partitioned.Die.length > 0) { |
| 304 | return partitioned.Die[0].defect |
| 305 | } else if (partitioned.Interrupt.length > 0) { |
| 306 | return new globalThis.Error("All fibers interrupted without error") |
| 307 | } |
| 308 | return new globalThis.Error("Empty cause") |
| 309 | } |
| 310 | |
| 311 | /** @internal */ |
| 312 | export const causePrettyErrors = <E>(self: Cause.Cause<E>, options?: { |
no test coverage detected