effect-io-ai

Package: effect
Module: Request

Request.Error

A utility type to extract the error type from a Request.

Example (Extracting a request error type)

import type { Request } from "effect"

interface GetUser extends Request.Request<string, Error> {
  readonly id: number
}

// Extract the error type from a Request using the utility
type UserError = Request.Error<GetUser> // Error

Signature

type Error<T> = [T] extends [Request<infer _A, infer _E, infer _R>] ? _E : never

Source

Since v2.0.0