diff --git a/scripts/BaseOllama.py b/scripts/BaseOllama.py index 1ce841e..10d3610 100644 --- a/scripts/BaseOllama.py +++ b/scripts/BaseOllama.py @@ -36,5 +36,5 @@ class OllamaChatBot: messanges = self.messanges try: return self.ollama.invoke(messanges).content - except ValueError: - return "An unexpected Error occuried" + except ValueError as e: + return f"An unexpected Error occuried: {e}" diff --git a/scripts/GUIChat.py b/scripts/GUIChat.py index 51a35e8..d3fc42b 100644 --- a/scripts/GUIChat.py +++ b/scripts/GUIChat.py @@ -39,8 +39,8 @@ class ChatGUI(CTk.CTk): else: return self.bot.get_request(prompt=prompt) - except ValueError: - return "An unexpected Error occuried" + except ValueError as e: + return f"An unexpected Error occuried: {e}" def on_send(self, event=None): message = self.entry_bar.get().strip() diff --git a/scripts/Rag.py b/scripts/Rag.py index 3113bd9..0c5ee16 100644 --- a/scripts/Rag.py +++ b/scripts/Rag.py @@ -84,12 +84,12 @@ class Rag: return (False, "Success") else: return (True, f"'{file_path}' unsupported, read documentation for more information") - except (ValueError, AttributeError): - return (True, "An unexpected Error occuried") + except (ValueError, AttributeError) as e: + return (True, f"An unexpected Error occuried: {e}") def get_request(self, prompt): qachain=RetrievalQA.from_chain_type(self.chat_ollama, retriever=self.retriever) try: return qachain.invoke({"query": prompt})["result"] - except ValueError: - return (True, "An unexpected Error occuried") + except ValueError as e: + return (True, f"An unexpected Error occuried: {e}") \ No newline at end of file