Skip to content

Commit bdf439a

Browse files
committed
enhance: do not show error message if it is empty
Signed-off-by: leo <[email protected]>
1 parent 7bfb95f commit bdf439a

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/Commands/ExecuteCustomAction.cs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ public static void Run(string repo, string file, string args)
3131
}
3232
catch (Exception e)
3333
{
34-
Dispatcher.UIThread.Invoke(() =>
35-
{
36-
App.RaiseException(repo, e.Message);
37-
});
34+
Dispatcher.UIThread.Invoke(() => App.RaiseException(repo, e.Message));
3835
}
3936
}
4037

@@ -87,19 +84,14 @@ public static void RunAndWait(string repo, string file, string args, Action<stri
8784
var exitCode = proc.ExitCode;
8885
if (exitCode != 0)
8986
{
90-
var errMsg = builder.ToString();
91-
Dispatcher.UIThread.Invoke(() =>
92-
{
93-
App.RaiseException(repo, errMsg);
94-
});
87+
var errMsg = builder.ToString().Trim();
88+
if (!string.IsNullOrEmpty(errMsg))
89+
Dispatcher.UIThread.Invoke(() => App.RaiseException(repo, errMsg));
9590
}
9691
}
9792
catch (Exception e)
9893
{
99-
Dispatcher.UIThread.Invoke(() =>
100-
{
101-
App.RaiseException(repo, e.Message);
102-
});
94+
Dispatcher.UIThread.Invoke(() => App.RaiseException(repo, e.Message));
10395
}
10496

10597
proc.Close();

0 commit comments

Comments
 (0)