Fix LogEntries: collection was modified exception (#309)

* _options.LogEntries.ToArray()

* .

* update error message
This commit is contained in:
Stef Heyenrath
2019-08-10 16:46:53 +02:00
committed by GitHub
parent 19dd9e113e
commit 65688ee7d3
9 changed files with 44 additions and 12 deletions

View File

@@ -118,7 +118,7 @@ namespace WireMock.Owin
await Task.Delay(_options.RequestProcessingDelay.Value);
}
response = await targetMapping.ResponseToAsync(request);
response = await targetMapping.ProvideResponseAsync(request);
if (targetMapping.Scenario != null)
{
@@ -129,7 +129,7 @@ namespace WireMock.Owin
}
catch (Exception ex)
{
_options.Logger.Error("HttpStatusCode set to 500");
_options.Logger.Error($"Providing a Response for Mapping '{result.TargetMapping.Guid}' failed. HttpStatusCode set to 500. Exception: {ex}");
response = ResponseMessageBuilder.Create(JsonConvert.SerializeObject(ex), 500);
}
finally