I'd like to enhance the httpErrorhandler middleware and create a wrapper around it in my nodejs lambda code.
Currently, I have something similar to this.
module.exports.handler=middy(handle).use(httpErrorHandler(LoggingFactory.getLogger().log))
I'd like to make a customHttpErrorHandler that acts as a wrapper around httpErrorHandler.
module.exports.handler=middy(handle).use(customHttpErrorHandler(LoggingFactory.getLogger().log))
Is that even possible? What should I provide in customHttpErrorHandler? There isn't any new functionality that needs to be added. The control should be passed to the normal httpErrorHandler via this new customHandler.
Below is an example of a customHttpErrorHandler (pseudo code).
connectHttpErrorHandler = (logger) => httpErrorHandler(logger)