mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-19 01:47:08 +01:00
16 lines
344 B
C#
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
|
|
};
|
|
}
|
|
} |