Companion

object Companion

Properties

Link copied to clipboard

Every entry indexed by its code. Because the libtorrent codes form a contiguous range 0 .. error_code_max - 1, this is a dense lookup table: entries[c].code == c for all c in 0 until ENTRY_COUNT.

Link copied to clipboard
const val ENTRY_COUNT: Int = 219

The number of distinct error codes, mirroring libtorrent's errors::error_code_max (the sentinel just past the last valid code).

Functions

Link copied to clipboard

Resolve a raw integer error value to its LibtorrentError, throwing IllegalArgumentException when code is out of range.

Link copied to clipboard

Resolve a raw integer error value to its LibtorrentError, or null when code is outside the known range. Mirrors the bounds check in libtorrent_error_category::message(), which returns "Unknown error" for out-of-range values.

Link copied to clipboard
fun messageOf(code: Int): String

The category message for a raw integer value. Faithful to libtorrent_category().message(ev): returns "Unknown error" for any value outside 0 until ENTRY_COUNT.