Skip to content

Commit f527112

Browse files
Handle NoClassDefFoundError in probeToolSupport with conflicting classpath error dialog (#285)
* Initial plan * Handle NoClassDefFoundError in probeToolSupport with error pane for conflicting classpath Co-authored-by: jGauravGupta <15934072+jGauravGupta@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jGauravGupta <15934072+jGauravGupta@users.noreply.github.com>
1 parent fcd5c89 commit f527112

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/main/java/io/github/jeddict/ai/lang/JeddictBrain.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
import static io.github.jeddict.ai.lang.InteractionMode.INTERACTIVE;
5252
import io.github.jeddict.ai.util.PropertyChangeEmitter;
5353
import java.lang.reflect.InvocationTargetException;
54+
import org.openide.DialogDisplayer;
55+
import org.openide.NotifyDescriptor;
5456
import java.util.ArrayList;
5557
import java.util.Arrays;
5658
import java.util.Collections;
@@ -307,6 +309,18 @@ protected boolean probeToolSupport() {
307309
);
308310

309311
return toolsSupport;
312+
} catch (final NoClassDefFoundError e) {
313+
LOG.severe(() ->
314+
"error probing tool support (conflicting classpath), returning false %s\n%s".formatted(
315+
e.toString(),
316+
Arrays.toString(e.getStackTrace())
317+
)
318+
);
319+
final NotifyDescriptor nd = new NotifyDescriptor.Message(
320+
"AI tool support probe failed due to a conflicting classpath issue: " + e.toString(),
321+
NotifyDescriptor.ERROR_MESSAGE
322+
);
323+
DialogDisplayer.getDefault().notify(nd);
310324
} catch (final Throwable t) {
311325
LOG.severe(() ->
312326
"error probing tool support, returning false %s\n%s".formatted(

0 commit comments

Comments
 (0)