mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-18 06:29:38 +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:
16
src/WireMock.Net/Extensions/ExceptionExtensions.cs
Normal file
16
src/WireMock.Net/Extensions/ExceptionExtensions.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
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
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user