* Creates an HttpRequestError from a platform HttpClientError.RequestError. * * @example * ```ts * import { AiError } from "@effect/ai" * import { HttpClientError } from "@effect/platform" * import { Option } from "effect" * * declare const platformError: HttpClientError.Requ
({ error, ...params }: {
readonly module: string
readonly method: string
readonly error: HttpClientError.RequestError
})
| 225 | * @category Constructors |
| 226 | */ |
| 227 | static fromRequestError({ error, ...params }: { |
| 228 | readonly module: string |
| 229 | readonly method: string |
| 230 | readonly error: HttpClientError.RequestError |
| 231 | }): HttpRequestError { |
| 232 | return new HttpRequestError({ |
| 233 | ...params, |
| 234 | cause: error, |
| 235 | description: error.description, |
| 236 | reason: error.reason, |
| 237 | request: { |
| 238 | hash: error.request.hash, |
| 239 | headers: Inspectable.redact(error.request.headers) as any, |
| 240 | method: error.request.method, |
| 241 | url: error.request.url, |
| 242 | urlParams: error.request.urlParams |
| 243 | } |
| 244 | }, { disableValidation: true }) |
| 245 | } |
| 246 | |
| 247 | get message(): string { |
| 248 | const methodAndUrl = `${this.request.method} ${this.request.url}` |
no outgoing calls
no test coverage detected