diff --git a/diylc/diylc-swing/src/main/java/org/diylc/swing/plugins/chatbot/ChatbotPane.java b/diylc/diylc-swing/src/main/java/org/diylc/swing/plugins/chatbot/ChatbotPane.java index ceb46b0f..0245cbf7 100644 --- a/diylc/diylc-swing/src/main/java/org/diylc/swing/plugins/chatbot/ChatbotPane.java +++ b/diylc/diylc-swing/src/main/java/org/diylc/swing/plugins/chatbot/ChatbotPane.java @@ -1,5 +1,6 @@ package org.diylc.swing.plugins.chatbot; +import org.apache.log4j.Logger; import org.diylc.common.IPlugInPort; import org.diylc.common.ITask; import org.diylc.core.IView; @@ -7,6 +8,7 @@ import org.diylc.plugins.chatbot.presenter.ChatbotPresenter; import org.diylc.plugins.cloud.presenter.CloudPresenter; import org.diylc.plugins.cloud.presenter.NotLoggedInException; import org.diylc.swing.ISwingUI; +import org.diylc.swing.plugins.config.ConfigPlugin; import javax.swing.*; import java.awt.*; @@ -18,6 +20,8 @@ public class ChatbotPane extends JPanel { private static final long serialVersionUID = 1L; + private static final Logger LOG = Logger.getLogger(ChatbotPane.class); + public static Font DEFAULT_FONT = new Font("Square721 BT", Font.PLAIN, 12); private static final Font MONOSPACED_FONT = new Font("Monospaced", Font.PLAIN, 12); private static final Color TERMINAL_BG = new Color(40, 40, 40); @@ -200,9 +204,9 @@ public class ChatbotPane extends JPanel { "", MONOSPACED_FONT.getFamily(), MONOSPACED_FONT.getSize(), @@ -255,8 +259,8 @@ public class ChatbotPane extends JPanel { @Override public void failed(Exception e) { - swingUI.showMessage("Failed to ask AI Assistant. Error: " + e.getMessage(), "AI Assistant Error", - IView.ERROR_MESSAGE); + appendSection("system", "Failed to retrieve the response from the server. Error: " + e.getMessage()); + LOG.error("Failed to retrieve the response from the server", e); getClearButton().setEnabled(true); }