Fail
job.fail()
job.fail()
Example Usage
const job = pulse.create('test', {});
job.fail(new Error('Unable to connect to database'));
job.save(); // If you want to save it
Parameters
reason
(string | Error
): The reason for the job's failure, which can be provided as either a string or an Error object. If an Error object is provided, its message is used as the failure reason.
Returns
Job
: Returns the job instance, allowing for method chaining.
Last updated
Was this helpful?