Skip to content

Errors

The exception types you can meet, and what each one means.

ExceptionThrown whenTypical response
MqttExceptionAn operation could not complete: handshake timeout, the connection closed mid-operation, an acknowledgement or RPC reply timed outRetry the operation or surface it; the supervisor handles the connection itself
MqttProtocolExceptionThe peer violated the protocol: malformed packet, invalid QoS, unexpected packet typeNothing to retry — the connection faults and reconnects; persistent occurrences mean a broken broker or middlebox
MqttConnectRejectedExceptionThe broker answered CONNECT with a non-success reason; carries ReasonCode, plus ReasonString and ServerReference when the broker sent themInspect the reason: credentials, authorization, identifier, or redirect details
TerminalMqttConnectExceptionThe reconnect machinery gave up: the decision classified a failure as final, or the attempt cap was reachedThe client is Faulted; fix the cause, then ConnectAsync
OfflineQueueFullExceptionA publish hit a full offline queue under the Reject policy, or a Blocked publish exceeded PublishWaitTimeoutShed load, raise capacity, or pick a drop policy
InvalidOperationExceptionAPI misuse: typed call without a serializer, ConnectAsync while running, registration validation failuresFix the code or configuration; messages name the exact problem

Guarantees worth knowing:

  • The decoder throws only MqttProtocolException for malformed input — fuzz-verified, so hostile bytes cannot surface arbitrary exceptions.
  • A route handler's exception never escapes its route: it is logged (RouteHandlerFaulted) and isolates that route only — see Routing.
  • A publish never fails silently: the outcome enumerates delivery, queueing, or the explicit drop — see Publishing.

Released under the MIT License.