ExceededCapacityErrorAn 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"export interface ExceededCapacityError extends YieldableError {
readonly [const ExceededCapacityErrorTypeId: "~effect/Cause/ExceededCapacityError"Unique brand for ExceededCapacityError.
ExceededCapacityErrorTypeId]: typeof const ExceededCapacityErrorTypeId: "~effect/Cause/ExceededCapacityError"Unique brand for ExceededCapacityError.
ExceededCapacityErrorTypeId
readonly ExceededCapacityError._tag: "ExceededCapacityError"_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 const ExceededCapacityError: new (
message?: string
) => 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"
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)
import { Cause } from "effect"
const error = new Cause.ExceededCapacityError("Queue full")
console.log(error.message) // "Queue full"
ExceededCapacityError: new(message: string | undefinedmessage?: string) => ExceededCapacityError = import effecteffect.class ExceededCapacityErrorExceededCapacityError