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

Class TransportError

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

Source from the content-addressed store, hash-verified

204 * @since 4.0.0
205 */
206export class TransportError extends ReasonError("TransportError")<{
207 readonly request: HttpClientRequest.HttpClientRequest
208 readonly cause?: unknown
209 readonly description?: string
210}> {
211 /**
212 * Formats the request method and URL for transport error messages.
213 *
214 * @stability unstable
215 * @since 4.0.0
216 */
217 get methodAndUrl() {
218 return formatMethodAndUrl(this)
219 }
220
221 /**
222 * Builds the transport error message from the optional description and request details.
223 *
224 * @stability unstable
225 * @since 4.0.0
226 */
227 override get message() {
228 return formatMessage(formatReason(this._tag), this.description, this.methodAndUrl)
229 }
230
231 override toJSON(): unknown {
232 return reasonToJSON(this, super.toJSON())
233 }
234}
235
236/**
237 * Error describing failures while encoding an HTTP request body.

Callers

nothing calls this directly

Calls 1

ReasonErrorFunction · 0.85

Tested by

no test coverage detected