Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,19 @@ ToolCallingContentObservationFilter toolCallingContentObservationFilter() {

private static Class<? extends RuntimeException> getClassOrNull(String className) {
try {
return (Class<? extends RuntimeException>) ClassUtils.forName(className, null);
Class<?> clazz = ClassUtils.forName(className, null);
if (RuntimeException.class.isAssignableFrom(clazz)) {
return (Class<? extends RuntimeException>) clazz;
}
else {
logger.debug("Class {} is not a subclass of RuntimeException", className);
}
}
catch (ClassNotFoundException e) {
logger.debug("Cannot load class", e);
logger.debug("Cannot load class: {}", className);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This log can still confuse users. Maybe it's better to catch this exception at line 88 and explain why this class is needed.

}
catch (Exception e) {
logger.debug("Error loading class: {}", className, e);
}
return null;
}
Expand Down