enhance: do not show error message if it is empty

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-02-26 16:33:11 +08:00
parent 7bfb95f7ce
commit bdf439a742
No known key found for this signature in database

View file

@ -31,10 +31,7 @@ namespace SourceGit.Commands
}
catch (Exception e)
{
Dispatcher.UIThread.Invoke(() =>
{
App.RaiseException(repo, e.Message);
});
Dispatcher.UIThread.Invoke(() => App.RaiseException(repo, e.Message));
}
}
@ -87,19 +84,14 @@ namespace SourceGit.Commands
var exitCode = proc.ExitCode;
if (exitCode != 0)
{
var errMsg = builder.ToString();
Dispatcher.UIThread.Invoke(() =>
{
App.RaiseException(repo, errMsg);
});
var errMsg = builder.ToString().Trim();
if (!string.IsNullOrEmpty(errMsg))
Dispatcher.UIThread.Invoke(() => App.RaiseException(repo, errMsg));
}
}
catch (Exception e)
{
Dispatcher.UIThread.Invoke(() =>
{
App.RaiseException(repo, e.Message);
});
Dispatcher.UIThread.Invoke(() => App.RaiseException(repo, e.Message));
}
proc.Close();