From b915d491c71069cb393851ea29c4403db51dd6cf Mon Sep 17 00:00:00 2001 From: Ivandro Jao Date: Thu, 20 Jun 2024 19:21:03 +0100 Subject: [PATCH] Add debug-specific error message in AutoTranslate.cs In a wrap catch of the AutoTranslate.cs file, a conditional directive was added to display different error messages for DEBUG and RELEASE modes. This ensures that detailed exception information is shown during debugging for better troubleshooting, while a more user-friendly message is used in the release build. Signed-off-by: Ivandro Jao --- src/ui/Forms/Translate/AutoTranslate.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ui/Forms/Translate/AutoTranslate.cs b/src/ui/Forms/Translate/AutoTranslate.cs index bc1baa10a..6d93d6759 100644 --- a/src/ui/Forms/Translate/AutoTranslate.cs +++ b/src/ui/Forms/Translate/AutoTranslate.cs @@ -1467,8 +1467,12 @@ namespace Nikse.SubtitleEdit.Forms.Translate } catch (Exception exception) { +#if DEBUG + MessageBox.Show(exception.Message); +#else MessageBox.Show("Unable to get ollama models - is ollama running?" + Environment.NewLine + exception.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Error); SeLogger.Error(exception, "Unable to get ollama models"); +#endif } async Task> GetModelsAsync(string url)