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

Method toJSON

packages/effect/src/http/HttpClientError.ts:88–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86 }
87
88 override toJSON(): unknown {
89 const json = super.toJSON() as Record<string, unknown>
90 // A copy of the reason's cause, which `InvalidUrlError` keeps out of its JSON.
91 if (this.reason._tag === "InvalidUrlError") delete json.cause
92 return json
93 }
94}
95
96const formatReason = (tag: string) => tag.endsWith("Error") ? tag.slice(0, -5) : tag

Callers

nothing calls this directly

Calls 1

toJSONMethod · 0.65

Tested by

no test coverage detected