From 11b6f5b7432a0c876bda4627da0f907c01a46f04 Mon Sep 17 00:00:00 2001 From: Mayuki Sawatari Date: Wed, 6 Mar 2024 01:36:39 +0900 Subject: [PATCH] Prevent exception propagation to host --- src/Cocona.Lite/Lite/Hosting/CoconaLiteAppHost.cs | 2 -- src/Cocona/Hosting/CoconaHostedService.cs | 1 - 2 files changed, 3 deletions(-) diff --git a/src/Cocona.Lite/Lite/Hosting/CoconaLiteAppHost.cs b/src/Cocona.Lite/Lite/Hosting/CoconaLiteAppHost.cs index 8eb193e..1a33581 100644 --- a/src/Cocona.Lite/Lite/Hosting/CoconaLiteAppHost.cs +++ b/src/Cocona.Lite/Lite/Hosting/CoconaLiteAppHost.cs @@ -61,8 +61,6 @@ public async Task RunAsync(CancellationToken cancellationToken) { console.Error.WriteLine(ex.ToString()); Environment.ExitCode = 1; - // NOTE: Exception is suppressed here to match the behavior of Cocona. - //throw; } _waitForShutdown.Set(); diff --git a/src/Cocona/Hosting/CoconaHostedService.cs b/src/Cocona/Hosting/CoconaHostedService.cs index f51fbf8..6e9b154 100644 --- a/src/Cocona/Hosting/CoconaHostedService.cs +++ b/src/Cocona/Hosting/CoconaHostedService.cs @@ -71,7 +71,6 @@ private async Task ExecuteCoconaApplicationAsync(Task waitForApplicationStarted) { _console.Error.WriteLine(ex.ToString()); Environment.ExitCode = 1; - throw; } finally {