Skip to content

Errors — Concurrent

Package: @litert/concurrentSource: packages/partials/concurrent/src/Types.ts, packages/partials/concurrent/src/Classes/MemoryMutex.ts


E_RATE_LIMITED

Error thrown when a rate limiter blocks a call.

ts
import { E_RATE_LIMITED } from '@litert/concurrent';
PropertyValue
message'The rate limit has been exceeded.'
name'rate_limited'
ExtendsError

Notes

  • Thrown by CountingRateLimiter, TokenBucketRateLimiter, LeakyBucketRateLimiter, and their manager variants when a challenge fails.
  • The concrete error class can be replaced via the errorCtorOnLimited option in each rate limiter's constructor.

E_BREAKER_OPENED

Error thrown when a circuit breaker is open and blocks a call.

ts
import { E_BREAKER_OPENED } from '@litert/concurrent';
PropertyValue
message'The breaker is open.'
name'breaker_opened'
ExtendsError

Notes

  • Thrown by ManualBreaker and CircuitBreaker when call() is invoked while the breaker is open.
  • The concrete error class can be replaced via the errorCtorOnOpen / errorCtor option in each breaker's constructor.

E_LOCK_FAILED

Error thrown when a mutex lock cannot be acquired.

ts
import { E_LOCK_FAILED } from '@litert/concurrent';
PropertyValue
message'Failed to acquire the lock.'
name'lock_failed'
ExtendsError

Notes

  • Thrown by MemoryMutex.run() and MemoryMutex.wrap() when the lock is not available.