Skip to content

Commit e8f2522

Browse files
committed
Don't report an error when service stop is requested.
1 parent c5124c3 commit e8f2522

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/CodeCaster.WindowsServiceExtensions/Service/WindowsServiceBackgroundService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ protected sealed override async Task ExecuteAsync(CancellationToken stoppingToke
6363

6464
await TryExecuteAsync(stoppingToken);
6565
}
66-
catch (Exception ex)
66+
catch (Exception ex) when (!stoppingToken.IsCancellationRequested)
6767
{
6868
Logger.LogInformation(ex, "Unhandled exception in {serviceType}, setting process exit code to {exitCode}:", GetType().FullName, ErrorInvalidData);
6969

0 commit comments

Comments
 (0)