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

Method fromDefect

packages/effect/src/unstable/cluster/Reply.ts:93–107  ·  view source on GitHub ↗

* Creates a terminal reply context that dies with the supplied defect. * * @since 4.0.0

(options: {
    readonly id: Snowflake
    readonly requestId: Snowflake
    readonly defect: unknown
  })

Source from the content-addressed store, hash-verified

91 * @since 4.0.0
92 */
93 static fromDefect(options: {
94 readonly id: Snowflake
95 readonly requestId: Snowflake
96 readonly defect: unknown
97 }): ReplyWithContext<any> {
98 return new ReplyWithContext({
99 reply: new WithExit({
100 requestId: options.requestId,
101 id: options.id,
102 exit: Exit.die(Schema.encodeSync(Schema.Defect())(options.defect))
103 }),
104 context: Context.empty() as any,
105 rpc: neverRpc
106 })
107 }
108 /**
109 * Creates a terminal reply context that interrupts the supplied request.
110 *

Callers 4

serializeOrDefectFunction · 0.80
Sharding.tsFile · 0.80
serializeDefectReplyFunction · 0.80
decodeMessagesFunction · 0.80

Calls 1

encodeSyncMethod · 0.80

Tested by

no test coverage detected