mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-26 18:28:27 +02:00
Write logging in case a Matcher throws an exception (#986)
* ThrowException * ... * . * ... * b * fix test * ... * . * sonar * ft * . * fix tst
This commit is contained in:
@@ -50,7 +50,7 @@ namespace WireMock.Owin.Mappers
|
||||
_options = Guard.NotNull(options);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IOwinResponseMapper.MapAsync"/>
|
||||
/// <inheritdoc />
|
||||
public async Task MapAsync(IResponseMessage? responseMessage, IResponse response)
|
||||
{
|
||||
if (responseMessage == null)
|
||||
@@ -134,10 +134,8 @@ namespace WireMock.Owin.Mappers
|
||||
return (responseMessage.BodyData.Encoding ?? _utf8NoBom).GetBytes(responseMessage.BodyData.BodyAsString!);
|
||||
|
||||
case BodyType.Json:
|
||||
var formatting = responseMessage.BodyData.BodyAsJsonIndented == true
|
||||
? Formatting.Indented
|
||||
: Formatting.None;
|
||||
string jsonBody = JsonConvert.SerializeObject(responseMessage.BodyData.BodyAsJson, new JsonSerializerSettings { Formatting = formatting, NullValueHandling = NullValueHandling.Ignore });
|
||||
var formatting = responseMessage.BodyData.BodyAsJsonIndented == true ? Formatting.Indented : Formatting.None;
|
||||
var jsonBody = JsonConvert.SerializeObject(responseMessage.BodyData.BodyAsJson, new JsonSerializerSettings { Formatting = formatting, NullValueHandling = NullValueHandling.Ignore });
|
||||
return (responseMessage.BodyData.Encoding ?? _utf8NoBom).GetBytes(jsonBody);
|
||||
|
||||
case BodyType.Bytes:
|
||||
|
||||
Reference in New Issue
Block a user