Commit 64ec337
Only log class name on ToolCallingAutoConfiguration#ClassNotFoundException in getClassOrNull
Fixes #4205
Fixes #4249
The getClassOrNull method is designed to gracefully handle missing classes
by returning null, but was logging full stack traces for ClassNotFoundException
which could mislead users into thinking there's an actual problem.
Changes:
- Log only the class name when ClassNotFoundException occurs
- Add type safety check for RuntimeException subclasses
- Add separate handling for other exceptions with full stack trace
- Improve log message clarity to reduce user confusion
This maintains the expected behavior while providing cleaner, less alarming
log output for normal class-not-found scenarios.
Signed-off-by: Sun Yuhan <[email protected]>
(cherry picked from commit befaf87)1 parent 6f61562 commit 64ec337
File tree
1 file changed
+11
-2
lines changed- auto-configurations/models/tool/spring-ai-autoconfigure-model-tool/src/main/java/org/springframework/ai/model/tool/autoconfigure
1 file changed
+11
-2
lines changedLines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
129 | 135 | | |
130 | 136 | | |
131 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
132 | 141 | | |
133 | 142 | | |
134 | 143 | | |
| |||
0 commit comments