diff --git a/dotnet/samples/03-workflows/Checkpoint/CheckpointAndRehydrate/Program.cs b/dotnet/samples/03-workflows/Checkpoint/CheckpointAndRehydrate/Program.cs index e2b4a25036..49752e256d 100644 --- a/dotnet/samples/03-workflows/Checkpoint/CheckpointAndRehydrate/Program.cs +++ b/dotnet/samples/03-workflows/Checkpoint/CheckpointAndRehydrate/Program.cs @@ -65,8 +65,7 @@ public static class Program Console.Error.WriteLine(workflowError.Exception?.ToString() ?? "Unknown workflow error occurred."); Console.ResetColor(); } - - if (evt is ExecutorFailedEvent executorFailed) + else if (evt is ExecutorFailedEvent executorFailed) { Console.ForegroundColor = ConsoleColor.Red; Console.Error.WriteLine($"Executor '{executorFailed.ExecutorId}' failed with {(executorFailed.Data == null ? "unknown error" : $"exception {executorFailed.Data}")}."); @@ -107,8 +106,7 @@ public static class Program Console.Error.WriteLine(workflowError.Exception?.ToString() ?? "Unknown workflow error occurred."); Console.ResetColor(); } - - if (evt is ExecutorFailedEvent executorFailed) + else if (evt is ExecutorFailedEvent executorFailed) { Console.ForegroundColor = ConsoleColor.Red; Console.Error.WriteLine($"Executor '{executorFailed.ExecutorId}' failed with {(executorFailed.Data == null ? "unknown error" : $"exception {executorFailed.Data}")}."); diff --git a/dotnet/samples/03-workflows/Checkpoint/CheckpointAndResume/Program.cs b/dotnet/samples/03-workflows/Checkpoint/CheckpointAndResume/Program.cs index 5dcf524dc6..510fb9f345 100644 --- a/dotnet/samples/03-workflows/Checkpoint/CheckpointAndResume/Program.cs +++ b/dotnet/samples/03-workflows/Checkpoint/CheckpointAndResume/Program.cs @@ -62,8 +62,7 @@ public static class Program Console.Error.WriteLine(workflowError.Exception?.ToString() ?? "Unknown workflow error occurred."); Console.ResetColor(); } - - if (evt is ExecutorFailedEvent executorFailed) + else if (evt is ExecutorFailedEvent executorFailed) { Console.ForegroundColor = ConsoleColor.Red; Console.Error.WriteLine($"Executor '{executorFailed.ExecutorId}' failed with {(executorFailed.Data == null ? "unknown error" : $"exception {executorFailed.Data}")}."); @@ -101,8 +100,7 @@ public static class Program Console.Error.WriteLine(workflowError.Exception?.ToString() ?? "Unknown workflow error occurred."); Console.ResetColor(); } - - if (evt is ExecutorFailedEvent executorFailed) + else if (evt is ExecutorFailedEvent executorFailed) { Console.ForegroundColor = ConsoleColor.Red; Console.Error.WriteLine($"Executor '{executorFailed.ExecutorId}' failed with {(executorFailed.Data == null ? "unknown error" : $"exception {executorFailed.Data}")}."); diff --git a/dotnet/samples/03-workflows/ConditionalEdges/03_MultiSelection/Program.cs b/dotnet/samples/03-workflows/ConditionalEdges/03_MultiSelection/Program.cs index f74a1aabe0..6eac1cbcd9 100644 --- a/dotnet/samples/03-workflows/ConditionalEdges/03_MultiSelection/Program.cs +++ b/dotnet/samples/03-workflows/ConditionalEdges/03_MultiSelection/Program.cs @@ -105,8 +105,7 @@ public static class Program Console.Error.WriteLine(workflowError.Exception?.ToString() ?? "Unknown workflow error occurred."); Console.ResetColor(); } - - if (evt is ExecutorFailedEvent executorFailed) + else if (evt is ExecutorFailedEvent executorFailed) { Console.ForegroundColor = ConsoleColor.Red; Console.Error.WriteLine($"Executor '{executorFailed.ExecutorId}' failed with {(executorFailed.Data == null ? "unknown error" : $"exception {executorFailed.Data}")}.");