<PackageReference Include="OpenTelemetry.PersistentStorage.FileSystem" Version="1.2.0" />

OpenTelemetry.Internal.Guard

static class Guard
Methods for guarding against exception throwing values.
public static void ThrowIfDefault<T>(T value, string paramName = null) where T : struct, IEquatable<T>

Throw an exception if the value equals default.

public static void ThrowIfInvalidTimeout(int value, string paramName = null)

Throw an exception if the value is not considered a valid timeout.

public static void ThrowIfNegative(int value, string message = "Must not be negative", string paramName = null)

Throw an exception if the value is negative.

public static T ThrowIfNotOfType<T>(object value, string paramName = null)

Throw an exception if the value is not of the expected type.

public static void ThrowIfNull(object value, string paramName = null)

Throw an exception if the value is null.

public static void ThrowIfNullOrEmpty(string value, string paramName = null)

Throw an exception if the value is null or empty.

public static void ThrowIfNullOrWhitespace(string value, string paramName = null)

Throw an exception if the value is null or whitespace.

public static void ThrowIfOutOfRange(int value, string paramName = null, int min = -2147483648, int max = 2147483647, string minName = null, string maxName = null, string message = null)

Throw an exception if the value is not within the given range.

public static void ThrowIfOutOfRange(double value, string paramName = null, double min = -1.7976931348623157E+308, double max = 1.7976931348623157E+308, string minName = null, string maxName = null, string message = null)

Throw an exception if the value is not within the given range.

public static void ThrowIfUndefined<TEnum>(TEnum value, string paramName = null) where TEnum : struct, Enum

Throw an exception if the enum value is not a defined member of TEnum.

public static void ThrowIfUndefinedOrDefault<TEnum>(TEnum value, string paramName = null) where TEnum : struct, Enum

Throw an exception if the enum value is the default (zero) value or is not a defined member of TEnum.

public static void ThrowIfZero(int value, string message = "Must not be zero", string paramName = null)

Throw an exception if the value is zero.