You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
}
}
The text was updated successfully, but these errors were encountered:
No context in bull exceptions handler like in default one.
Add information about your environment
Additional context
Bull handler
The text was updated successfully, but these errors were encountered: