diff --git a/src/Misc/Curiosity.Tools.Web/CHANGELOG.md b/src/Misc/Curiosity.Tools.Web/CHANGELOG.md index 765b494..1d42f92 100644 --- a/src/Misc/Curiosity.Tools.Web/CHANGELOG.md +++ b/src/Misc/Curiosity.Tools.Web/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [1.3.1] + +### Added + +- Cancellation exception handling, write a message to WARN log + ## [1.3.0] - 2023-11-28 ### Changed diff --git a/src/Misc/Curiosity.Tools.Web/Controllers/MVCBaseController.cs b/src/Misc/Curiosity.Tools.Web/Controllers/MVCBaseController.cs index dad6959..31937cd 100644 --- a/src/Misc/Curiosity.Tools.Web/Controllers/MVCBaseController.cs +++ b/src/Misc/Curiosity.Tools.Web/Controllers/MVCBaseController.cs @@ -1,6 +1,7 @@ using System; using System.IO; using System.Text.Encodings.Web; +using System.Threading.Tasks; using Curiosity.Tools.Web.Resources; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Diagnostics; @@ -83,6 +84,11 @@ public ActionResult ErrorView( message = ex.Message; logger.LogWarning(ex, $"Connection was closed by the client while sending response: {ex.Message}."); break; + case TaskCanceledException _: + case OperationCanceledException _: + message = ex.Message; + logger.LogWarning(ex, "Request was canceled by user"); + break; default: logger.LogError(ex, $"Unhandled error: {ex.Message}"); break; diff --git a/src/Misc/Curiosity.Tools.Web/Curiosity.Tools.Web.csproj b/src/Misc/Curiosity.Tools.Web/Curiosity.Tools.Web.csproj index db093f9..d46ebc3 100644 --- a/src/Misc/Curiosity.Tools.Web/Curiosity.Tools.Web.csproj +++ b/src/Misc/Curiosity.Tools.Web/Curiosity.Tools.Web.csproj @@ -12,7 +12,7 @@ 1.0.0 1.0.0 - 1.3.0 + 1.3.1 Max Markelow (@markeli), Andrei Vinogradov (@anri-vin), Andrey Ioch (@DevCorvette) SIIS Ltd