Passing callback to customErrorHandler