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

Method _destroy

packages/platform/node-shared/src/NodeStream.ts:440–447  ·  view source on GitHub ↗
(error: Error | null, callback: (error?: Error | null | undefined) => void)

Source from the content-addressed store, hash-verified

438 }
439
440 override _destroy(error: Error | null, callback: (error?: Error | null | undefined) => void): void {
441 if (!this.fiber) {
442 return callback(error)
443 }
444 Effect.runFork(Fiber.interrupt(this.fiber)).addObserver((exit) => {
445 callback(exit._tag === "Failure" ? Cause.squash(exit.cause) as any : error)
446 })
447 }
448}
449
450const defaultOnError = (error: unknown): Cause.UnknownError => new Cause.UnknownError(error)

Callers

nothing calls this directly

Calls 3

addObserverMethod · 0.80
callbackFunction · 0.50
interruptMethod · 0.45

Tested by

no test coverage detected