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

Function onError

packages/effect/src/unstable/socket/Socket.ts:655–673  ·  view source on GitHub ↗
(cause: Event)

Source from the content-addressed store, hash-verified

653 }
654 }
655 function onError(cause: Event) {
656 ws.removeEventListener("message", onMessage)
657 ws.removeEventListener("close", onClose)
658 Deferred.doneUnsafe(
659 fiberSet.deferred,
660 Effect.fail(
661 new SocketError({
662 reason: open ?
663 new SocketReadError({
664 cause
665 }) :
666 new SocketOpenError({
667 kind: "Unknown",
668 cause
669 })
670 })
671 )
672 )
673 }
674 function onClose(event: globalThis.CloseEvent) {
675 const code = typeof event.code === "number" ? event.code : 1001
676 ws.removeEventListener("message", onMessage)

Callers 5

Effect.tsFile · 0.50
Layer.tsFile · 0.50
Stream.tsFile · 0.50
Param.tsFile · 0.50
effect.tsFile · 0.50

Calls 2

removeEventListenerMethod · 0.80
failMethod · 0.45

Tested by

no test coverage detected