In my lambda code written in nodejs, I want to extend the httpErrorhandler
middleware and create a wrapper around it.
Currently I have something like below.
module.exports.handler=middy(handle).use(httpErrorHandler(LoggingFactory.getLogger().log))
I want to create a customHttpErrorHandler
which is nothing but just a wrapper outside httpErrorHandler
.
module.exports.handler=middy(handle).use(customHttpErrorHandler(LoggingFactory.getLogger().log))
Is this possible? What do I need to put inside customHttpErrorHandler ? There is no additional functionality to be implemented. This new customHandler
should just pass the control to standard
httpErrorHandler
.
customHttpErrorHandler
might look something like below (pseudo code).
connectHttpErrorHandler = (logger) => httpErrorHandler(logger)