if (ref != null && exception == null) {
this.exception = routeContext.getCamelContext().getRegistry().lookupByNameAndType(ref, Exception.class);
}
ObjectHelper.notNull(exception, "exception or ref", this);
return new ThrowExceptionProcessor(exception);
}