Overview
The ErrorCode enum contains error codes that can be returned by BullMQ’s Lua scripts when operations fail.Enum
Error Codes
JobNotExist
-1
The specified job does not exist in Redis
JobLockNotExist
-2
The job’s lock does not exist
- The lock expired
- The job was never locked
- Another worker stole the lock
JobNotInState
-3
The job is not in the expected state for the requested operation
JobPendingChildren
-4
The job still has pending children and cannot be processed
ParentJobNotExist
-5
The parent job specified does not exist
JobLockMismatch
-6
The provided lock token doesn’t match the job’s current lock
ParentJobCannotBeReplaced
-7
The parent job cannot be replaced while it has children
JobBelongsToJobScheduler
-8
The job belongs to a job scheduler and cannot be modified directly
JobHasFailedChildren
-9
The job cannot proceed because it has failed children
SchedulerJobIdCollision
-10
A job scheduler with this ID already exists
SchedulerJobSlotsBusy
-11
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
