mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-29 21:31:45 +02: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
|
|
};
|
|
}
|
|
} |