InsufficientDataException

Thrown when the input data does not contain enough elements for the requested operation.

For example, computing variance requires at least two values, and some hypothesis tests require a minimum sample size. The message indicates the required minimum and the actual size received.

Example:

try {
doubleArrayOf(1.0).variance() // needs at least 2 values
} catch (e: InsufficientDataException) {
println(e.message) // "array must have at least 2 elements, got 1"
}

Parameters

message

a description of the size requirement that was not met.

Constructors

Link copied to clipboard
constructor(message: String)