mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
enhance: only dispatch error message if it contains valid data
This commit is contained in:
parent
26923435e7
commit
a99bd2e973
1 changed files with 7 additions and 11 deletions
|
@ -104,12 +104,8 @@ namespace SourceGit.Commands
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
if (RaiseError)
|
if (RaiseError)
|
||||||
{
|
Dispatcher.UIThread.Post(() => App.RaiseException(Context, e.Message));
|
||||||
Dispatcher.UIThread.Invoke(() =>
|
|
||||||
{
|
|
||||||
App.RaiseException(Context, e.Message);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,15 +116,15 @@ namespace SourceGit.Commands
|
||||||
int exitCode = proc.ExitCode;
|
int exitCode = proc.ExitCode;
|
||||||
proc.Close();
|
proc.Close();
|
||||||
|
|
||||||
if (!isCancelled && exitCode != 0 && errs.Count > 0)
|
if (!isCancelled && exitCode != 0)
|
||||||
{
|
{
|
||||||
if (RaiseError)
|
if (RaiseError)
|
||||||
{
|
{
|
||||||
Dispatcher.UIThread.Invoke(() =>
|
var errMsg = string.Join("\n", errs);
|
||||||
{
|
if (!string.IsNullOrWhiteSpace(errMsg))
|
||||||
App.RaiseException(Context, string.Join("\n", errs));
|
Dispatcher.UIThread.Post(() => App.RaiseException(Context, errMsg));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue