Hyperlinkv0.8.0-beta.28

Cause

Cause.ExceededCapacityErrorinterfaceeffect/Cause.ts:1594
ExceededCapacityError

An error indicating that a bounded resource (queue, pool, semaphore, etc.) has exceeded its capacity.

When to use

Use to model bounded-resource failures where an operation cannot proceed because capacity has been exhausted.

Details

Implements YieldableError.

Example (Creating and checking an ExceededCapacityError)

import { Cause } from "effect"

const error = new Cause.ExceededCapacityError("Queue full")
console.log(error._tag)    // "ExceededCapacityError"
console.log(error.message) // "Queue full"
errors
Source effect/Cause.ts:159427 lines
export interface ExceededCapacityError extends YieldableError {
  readonly [ExceededCapacityErrorTypeId]: typeof ExceededCapacityErrorTypeId
  readonly _tag: "ExceededCapacityError"
}

/**
 * Constructs an `ExceededCapacityError` with an optional message.
 *
 * **When to use**
 *
 * Use to create the error value for bounded-resource capacity failures.
 *
 * **Example** (Creating an ExceededCapacityError)
 *
 * ```ts
 * import { Cause } from "effect"
 *
 * const error = new Cause.ExceededCapacityError("Queue full")
 * console.log(error.message) // "Queue full"
 * ```
 *
 * @see {@link isExceededCapacityError} for checking unknown values
 *
 * @category constructors
 * @since 4.0.0
 */
export const ExceededCapacityError: new(message?: string) => ExceededCapacityError = effect.ExceededCapacityError
Referenced by 3 symbols