MCPcopy Index your code
hub / github.com/Effect-TS/effect / fromRequestError

Method fromRequestError

packages/ai/ai/src/AiError.ts:227–245  ·  view source on GitHub ↗

* 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
  })

Source from the content-addressed store, hash-verified

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}`

Callers 11

streamRequestFunction · 0.80
AnthropicClient.tsFile · 0.80
makeFunction · 0.80
streamRequestFunction · 0.80
streamRequestFunction · 0.80
makeFunction · 0.80
streamRequestFunction · 0.80
createResponseFunction · 0.80
createEmbeddingFunction · 0.80
streamRequestFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected