OpenTelemetry.Internal.Guard
Methods for guarding against exception throwing values.
Throw an exception if the value is not considered a valid timeout.
Throw an exception if the value is not of the expected type.
Throw an exception if the value is null.
Throw an exception if the value is null or empty.
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 ThrowIfZero(int value, string message = "Must not be zero", string paramName = null)
Throw an exception if the value is zero.