MeshtasticException

Sealed hierarchy of Meshtastic SDK exceptions.

Every subclass exposes optional transportIdentity and operation fields populated from the engine and transport modules so callers can attribute a failure without parsing the message string. Use tag to add context fluently when constructing from helpers.

Inheritors

Types

Link copied to clipboard

connect() called while already connected.

Link copied to clipboard
object Companion

Helpers for attaching diagnostic context.

Link copied to clipboard
class FirmwareTooOld(val required: Int, val present: Int) : MeshtasticException

Device reports a firmware version incompatible with this SDK.

Link copied to clipboard

Handshake timed out before completing.

Link copied to clipboard

Operation attempted while the client is not connected.

Link copied to clipboard
class PayloadTooLarge(val maxBytes: Int) : MeshtasticException

Payload exceeds the device's maximum data length (typically 233 bytes).

Link copied to clipboard
class Protocol(reason: String, cause: Throwable? = null) : MeshtasticException

Protocol violation: malformed wire data, handshake failure, unexpected packet structure.

Link copied to clipboard
class StorageUnavailable(message: String = "Storage unavailable", cause: Throwable? = null) : MeshtasticException

Storage backend became unavailable during operation.

Link copied to clipboard
class Transport(reason: String, cause: Throwable? = null) : MeshtasticException

Transport-level error: connection refused, network unreachable, I/O failure, etc.

Properties

Link copied to clipboard
expect open val cause: Throwable?
Link copied to clipboard
expect open val message: String?
Link copied to clipboard

A short operation tag (e.g. "connect", "engine.disconnect").

Link copied to clipboard

The TransportIdentity that produced this failure, if known.

Functions

Link copied to clipboard
fun <T : MeshtasticException> T.withContext(transportIdentity: TransportIdentity? = null, operation: String? = null): T

Attach diagnostic context. Returns this for fluent use.