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 <ivandrofly@gmail.com>
This commit is contained in:
Ivandro Jao 2024-06-20 19:21:03 +01:00
parent be16964b95
commit b915d491c7

View File

@ -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<List<string>> GetModelsAsync(string url)