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

Class EncodeError

packages/effect/src/http/HttpClientError.ts:243–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241 * @since 4.0.0
242 */
243export class EncodeError extends ReasonError("EncodeError")<{
244 readonly request: HttpClientRequest.HttpClientRequest
245 readonly cause?: unknown
246 readonly description?: string
247}> {
248 /**
249 * Formats the request method and URL for request encoding error messages.
250 *
251 * @stability unstable
252 * @since 4.0.0
253 */
254 get methodAndUrl() {
255 return formatMethodAndUrl(this)
256 }
257
258 /**
259 * Builds the request encoding error message from the optional description and request details.
260 *
261 * @stability unstable
262 * @since 4.0.0
263 */
264 override get message() {
265 return formatMessage(formatReason(this._tag), this.description, this.methodAndUrl)
266 }
267
268 override toJSON(): unknown {
269 return reasonToJSON(this, super.toJSON())
270 }
271}
272
273/**
274 * Error describing failures while constructing a URL from an HTTP client request.

Callers

nothing calls this directly

Calls 1

ReasonErrorFunction · 0.85

Tested by

no test coverage detected