KStatsException

open class KStatsException(message: String, cause: Throwable? = null) : RuntimeException(source)

Base exception for all errors thrown by the kstats library.

All kstats exceptions extend this class, so catching KStatsException will handle any error originating from the library. The optional cause allows chaining with an underlying throwable.

Example:

try {
doubleArrayOf().mean()
} catch (e: KStatsException) {
println(e.message) // "array must not be empty"
}

Parameters

message

a description of what went wrong.

cause

an optional underlying throwable that caused this exception.

Inheritors

Constructors

Link copied to clipboard
constructor(message: String, cause: Throwable? = null)