docs icon indicating copy to clipboard operation
docs copied to clipboard

Example GracePeriodManagerService, one line is not hit because of TaskCancelledException

Open mvonck opened this issue 5 years ago • 1 comments

In the example GracePeriodManagerService the line _logger.LogDebug($"GracePeriod background task is stopping."); is never hit because Task.Delay throws an TaskCancelledException. You don't see this exception, but when you add a try catch block arround it the logging line is hit.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

mvonck avatar Jun 23 '20 16:06 mvonck

A fixed implementation example can be found in this issue: https://github.com/dotnet/docs/issues/28251

ScrewThisBanana avatar Feb 15 '22 15:02 ScrewThisBanana