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