No context in bull exceptions handler like in default one.
Add information about your environment
OS: Ubuntu
Node 16
Adonis 5
Additional context
import Logger from '@ioc:Adonis/Core/Logger'
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
import HttpExceptionHandler from '@ioc:Adonis/Core/HttpExceptionHandler'
Default Adonis handler:
export default class ExceptionHandler extends HttpExceptionHandler {
public async handle(error: any, ctx: HttpContextContract) { // <----------- ctx
/**
* Forward rest of the exceptions to the parent class
*/
return super.handle(error, ctx)
}
}
Bull handler
import { LoggerContract } from '@ioc:Adonis/Core/Logger'
import { Job } from 'bullmq'
/**
* Bull exception handler serves as the base exception handler
* to handle all exceptions occured during the BULL queue execution
* lifecycle and makes appropriate response for them.
*/
export abstract class BullExceptionHandler {
constructor(protected logger: LoggerContract) {}
public async handle(error: any, job: Job) { // <------- no ctx
if (typeof error.handle === 'function') {
return error.handle(error, job)
}
this.logger.error(error.message)
}
}
No context in bull exceptions handler like in default one.
Add information about your environment
Additional context
Bull handler