in camel-k-core/support/src/main/java/org/apache/camel/k/support/SourcesSupport.java [180:192]
static boolean hasErrorHandlerFactory(RouteBuilder builder) {
//return builder.hasErrorHandlerFactory();
// TODO We need to replace the following workaround with the statement above once we switch to > camel-3.18
try {
Field f = RouteBuilder.class.getSuperclass().getDeclaredField("errorHandlerFactory");
f.setAccessible(true);
ErrorHandlerFactory privateErrorHandlerFactory = (ErrorHandlerFactory) f.get(builder);
LOGGER.debug("Looking up for private error handler factory: {}", privateErrorHandlerFactory);
return privateErrorHandlerFactory != null;
} catch (Exception e) {
throw new IllegalArgumentException("Something went wrong while checking the error handler factory", e);
}
}