Overview
The ErrorCode enum contains error codes that can be returned by BullMQ’s Lua scripts when operations fail.Enum
Error Codes
JobNotExist
The specified job does not exist in Redis
JobLockNotExist
The job’s lock does not exist
- The lock expired
- The job was never locked
- Another worker stole the lock
JobNotInState
The job is not in the expected state for the requested operation
JobPendingChildren
The job still has pending children and cannot be processed
ParentJobNotExist
The parent job specified does not exist
JobLockMismatch
The provided lock token doesn’t match the job’s current lock
ParentJobCannotBeReplaced
The parent job cannot be replaced while it has children
JobBelongsToJobScheduler
The job belongs to a job scheduler and cannot be modified directly
JobHasFailedChildren
The job cannot proceed because it has failed children
SchedulerJobIdCollision
A job scheduler with this ID already exists
SchedulerJobSlotsBusy
The job scheduler’s time slots are busy
Usage
These error codes are typically returned by internal Lua scripts and converted to JavaScript errors. You generally won’t use these directly, but they may appear in error messages:Handling Script Errors
When BullMQ operations fail, the errors usually include descriptive messages:Related
- UnrecoverableError - Error to fail jobs immediately
- RateLimitError - Error for rate limiting
- Job - Job class that may encounter these errors
