Ensure errorHandler.handler is a function