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

Function closeCode

packages/platform/node/src/NodeHttpServer.ts:962–963  ·  view source on GitHub ↗
(exit: Exit.Exit<unknown, unknown>)

Source from the content-addressed store, hash-verified

960// -----------------------------------------------------------------------------
961
962const closeCode = (exit: Exit.Exit<unknown, unknown>): number =>
963 Exit.isSuccess(exit) ? 1000 : Cause.hasInterruptsOnly(exit.cause) ? 1001 : 1011
964
965// Reported to middleware in place of the handler's discarded response.
966const upgradedResponse = Response.empty({ status: 101 })

Callers 1

makeUpgradeHandlerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected