From eb7cf46c95a5b7e6744c7c9f5642878c5e49e1f7 Mon Sep 17 00:00:00 2001 From: JvE-iO Date: Wed, 29 Jan 2025 12:54:46 +0100 Subject: [PATCH] Add exception message to logging when mapping fails due to an exception. --- src/WireMock.Net/Owin/WireMockMiddleware.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WireMock.Net/Owin/WireMockMiddleware.cs b/src/WireMock.Net/Owin/WireMockMiddleware.cs index a5445344..6ccd3242 100644 --- a/src/WireMock.Net/Owin/WireMockMiddleware.cs +++ b/src/WireMock.Net/Owin/WireMockMiddleware.cs @@ -224,7 +224,7 @@ namespace WireMock.Owin } catch (Exception ex) { - _options.Logger.Error("HttpStatusCode set to 404 : No matching mapping found", ex); + _options.Logger.Error("HttpStatusCode set to 404 : 'No matching mapping found', due to exception '{0}'", ex); var notFoundResponse = ResponseMessageBuilder.Create(HttpStatusCode.NotFound, WireMockConstants.NoMatchingFound); await _responseMapper.MapAsync(notFoundResponse, ctx.Response).ConfigureAwait(false);