try {
if (this.errorHandlerHelper.isInternal()) {
// Set internal error handler in the pipeline
context.setErrorHandler(
new TreeProcessorSitemapErrorHandler(this.errorHandlerHelper, env, context));
} else {
// Reset internal error handler (previous pipeline might had set it)
context.setErrorHandler(null);
}