* Creates a NetworkError from a platform HttpClientError.RequestError. * * **Example** (Creating a network error from a request error) * * ```ts import.meta.vitest * import { AiError } from "effect/unstable/ai" * import { HttpClientError, HttpClientRequest } from "effect/unstable/h
(error: HttpClientError.RequestError)
| 121 | * @since 4.0.0 |
| 122 | */ |
| 123 | static fromRequestError(error: HttpClientError.RequestError): NetworkError { |
| 124 | return new NetworkError({ |
| 125 | description: error.description, |
| 126 | reason: error._tag, |
| 127 | request: { |
| 128 | hash: Option.getOrUndefined(error.request.hash), |
| 129 | headers: redactHeaders(error.request.headers), |
| 130 | method: error.request.method, |
| 131 | url: error.request.url, |
| 132 | urlParams: Array.from(error.request.urlParams) |
| 133 | } |
| 134 | }) |
| 135 | } |
| 136 | |
| 137 | override get message(): string { |
| 138 | const methodAndUrl = `${this.request.method} ${this.request.url}` |
nothing calls this directly
no test coverage detected