<PackageReference Include="OpenTelemetry.Api" Version="1.15.1" />

OpenTelemetry.Internal.Guard

static class Guard
Methods for guarding against exception throwing values.
namespace OpenTelemetry.Internal { internal static class Guard { public static void ThrowIfNull(object value, string paramName = null); public static void ThrowIfNullOrEmpty(string value, string paramName = null); public static void ThrowIfNullOrWhitespace(string value, string paramName = null); public static void ThrowIfZero(int value, string message = "Must not be zero", string paramName = null); public static void ThrowIfInvalidTimeout(int value, string paramName = null); public static void ThrowIfOutOfRange(int value, string paramName = null, int min = int.MinValue, int max = int.MaxValue, string minName = null, string maxName = null, string message = null); public static void ThrowIfOutOfRange(double value, string paramName = null, double min = double.MinValue, double max = double.MaxValue, string minName = null, string maxName = null, string message = null); public static T ThrowIfNotOfType<T>(object value, string paramName = null); } }