New Feature
When rethrowing an error, the original error is now forwarded using the standard cause option.
This ensures the full error chain is preserved, making debugging and logging significantly easier.
export default class SendEmailJob extends Job<SendEmailPayload> {
static options: JobOptions = {
queue: 'email',
}
async execute(): Promise<void> {
console.log(`Sending email to: ${this.payload.to}`)
}
failed(e) {
console.log(e.cause)
}
}