Fix unhandled exception when target is unavailable (#469)

* wip

* fix

* 31

* known
This commit is contained in:
Stef Heyenrath
2020-05-18 15:07:30 +02:00
committed by GitHub
parent 7033d85e3a
commit d67a160144
6 changed files with 53 additions and 19 deletions

View File

@@ -129,7 +129,7 @@ namespace WireMock.Owin
catch (Exception ex)
{
_options.Logger.Error($"Providing a Response for Mapping '{result?.Mapping?.Guid}' failed. HttpStatusCode set to 500. Exception: {ex}");
response = ResponseMessageBuilder.Create(JsonConvert.SerializeObject(ex), 500);
response = ResponseMessageBuilder.Create(ex.Message, 500);
}
finally
{

View File

@@ -2,9 +2,8 @@
using WireMock.Admin.Mappings;
using WireMock.Admin.Requests;
using WireMock.Logging;
using WireMock.Types;
using WireMock.ResponseBuilders;
using WireMock.Util;
using WireMock.Types;
namespace WireMock.Serialization
{