Files
WireMock.Net-wiremock/src/WireMock.Net/Extensions/ExceptionExtensions.cs
Stef Heyenrath 93c87845c2 Write logging in case a Matcher throws an exception (#986)
* ThrowException

* ...

* .

* ...

* b

* fix test

* ...

* .

* sonar

* ft

* .

* fix tst
2023-08-21 20:07:46 +02:00

16 lines
344 B
C#

using System;
namespace WireMock.Extensions;
internal static class ExceptionExtensions
{
public static Exception? ToException(this Exception[] exceptions)
{
return exceptions.Length switch
{
1 => exceptions[0],
> 1 => new AggregateException(exceptions),
_ => null
};
}
}