Hyperlinkv0.8.0-beta.28

Cause

Cause.TimeoutErrorinterfaceeffect/Cause.ts:1453
TimeoutError

An error indicating that an operation exceeded its time limit.

Details

Produced by Effect.timeout and related APIs. Implements YieldableError.

Example (Creating and checking a TimeoutError)

import { Cause } from "effect"

const error = new Cause.TimeoutError("Operation timed out")
console.log(error._tag)    // "TimeoutError"
console.log(error.message) // "Operation timed out"
errors
Source effect/Cause.ts:145321 lines
export interface TimeoutError extends YieldableError {
  readonly [TimeoutErrorTypeId]: typeof TimeoutErrorTypeId
  readonly _tag: "TimeoutError"
}

/**
 * Constructs a `TimeoutError` with an optional message.
 *
 * **Example** (Creating a TimeoutError)
 *
 * ```ts
 * import { Cause } from "effect"
 *
 * const error = new Cause.TimeoutError("Operation timed out")
 * console.log(error.message) // "Operation timed out"
 * ```
 *
 * @category constructors
 * @since 4.0.0
 */
export const TimeoutError: new(message?: string) => TimeoutError = effect.TimeoutError
Referenced by 2 symbols