#[non_exhaustive]pub enum ErrorCode {
Show 41 variants
TlvTruncated,
TlvInvalidControl,
TlvContainerMismatch,
TlvWrongType,
TlvInvalidUtf8,
TlvInvalidTag,
TlvDepthExceeded,
TlvOutOfRange,
TlvNotFound,
TlvDuplicateTag,
MessageTruncated,
UnsupportedVersion,
MessageReserved,
DuplicateMessage,
IntegrityCheckFailed,
NoExchange,
NoSession,
MrpRetransmitExhausted,
NoSpace,
Busy,
BufferTooSmall,
InvalidArgument,
InvalidState,
AlreadyExists,
InvalidAction,
ReportWouldChunk,
CertInvalid,
CertPathInvalid,
CertExpired,
Unsupported,
DerMalformed,
AttestationFailed,
CommissioningFailed,
DnsTruncated,
DnsMalformed,
MessageTooLarge,
BdxAborted,
BtpMalformed,
BtpSequence,
BtpTimeout,
Platform,
}Expand description
What went wrong, locally.
The set is closed by this crate rather than by the specification, so it is
#[non_exhaustive]: new codes appear as layers land, and a consumer matching
exhaustively should not break for that.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TlvTruncated
A TLV element ended before its declared length.
TlvInvalidControl
A control octet named a reserved element type or an illegal tag control.
TlvContainerMismatch
A container was not terminated by an end-of-container element, or one appeared where no container was open.
TlvWrongType
The element is not of the type the reader was asked for.
TlvInvalidUtf8
A UTF-8 string element held bytes that are not valid UTF-8.
TlvInvalidTag
A structure member was anonymous, an array member was tagged, or a tag repeated inside a structure — Core §A.5.
TlvDepthExceeded
Container nesting went deeper than the reader’s fixed depth budget.
TlvOutOfRange
The value does not fit the requested Rust type (a u64 read as u8, say).
TlvNotFound
A required element was absent.
TlvDuplicateTag
Two members of one structure carried the same tag — Core §A.5.1: “All member elements within a structure SHALL have a unique tag as compared to the other members”.
MessageTruncated
The message is shorter than its own header says it is.
UnsupportedVersion
The message header version is not one this node speaks — Core §4.4.1.1.
MessageReserved
A reserved DSIZ or session-type value — Core §4.4.1.1, §4.4.1.3.
DuplicateMessage
The message counter is outside the replay window, or repeats one already seen.
IntegrityCheckFailed
Decryption or the integrity check failed.
NoExchange
No exchange matches the message, and none could be created for it.
NoSession
No session matches the message’s session id.
MrpRetransmitExhausted
A reliable message was retransmitted MRP_MAX_TRANSMISSIONS times without an
acknowledgement — Core §4.12.
NoSpace
A fixed-capacity table sized by Config is full.
Busy
The operation would block on a resource that is busy right now.
BufferTooSmall
A buffer given to this crate is too small for what was asked of it.
InvalidArgument
The argument is outside the range the specification allows.
InvalidState
The call is not legal in the current state.
AlreadyExists
The entry is already present and the operation does not replace it — the fabric
conflict of §11.18’s AddNOC, for one.
InvalidAction
An interaction model action is malformed and must be answered with a
StatusResponse carrying INVALID_ACTION rather than its usual response
(Core §8.10).
This is an action-level refusal, distinct from the per-path
Status a response carries: there is nothing well-formed enough
to report a path for.
ReportWouldChunk
A report does not fit in one message and must be chunked — Core §10.2.3.
Not a failure so much as the wrong method: the read is perfectly servable, just not
in a single message.
Server::serve_chunk serves it as the series of
messages §10.2.3 calls for. This exists so the one-message convenience can refuse
rather than emit a MoreChunkedMessages it has no way to honour, which would leave
the client waiting for a continuation that never comes.
CertInvalid
A Matter certificate violates one of the §6.5 encoding rules: an element out of order, a value out of range, a distinguished name the certificate’s type forbids.
CertPathInvalid
A certificate chain does not validate — a signature that does not verify, an issuer
that does not match, a path longer than a path-len-constraint allows.
CertExpired
A certificate is being used outside its not-before/not-after window.
Unsupported
The operation is defined but this build does not implement it.
DerMalformed
A DER encoding is malformed: a truncated element, a length that is not in DER’s shortest form, or a structure that is not what its context requires.
AttestationFailed
§6.2.3’s Device Attestation Procedure did not pass: a signature that does not verify, a nonce the device did not echo back, or a chain that does not reach a trusted PAA.
§5.5 step 10 makes this a report, not a verdict — “the Commissioner MAY choose to either continue to the Commissioning, or terminate it, depending on implementation-dependent policies” — so it reaches the caller rather than ending the flow on its own.
CommissioningFailed
A commissioning command answered with an error: §11.10.5.1’s CommissioningErrorEnum
or §11.18.5.1’s NodeOperationalCertStatusEnum, neither of which is OK.
DnsTruncated
A DNS message ended inside a name, a record, or a header.
DnsMalformed
A DNS message is malformed: a reserved label type, a compression pointer that does not point strictly backwards, a name with more labels than a Matter record has.
MessageTooLarge
A message on a stream transport announced a length past §4.15.2.3’s Maximum Message Size, or a length of zero.
Fatal to the connection either way. §4.5’s length prefix is the only message
boundary a stream has, so a receiver that cannot hold the message has also lost its
place: everything after it would be read as a header. §4.15.2.3 says to close, and
tcp::too_large is the report to send first.
BdxAborted
A BDX transfer ended in failure, and the §11.22.3.2 status code said why.
This is the code for a caller that had to widen a
bdx::StatusCode into the crate’s own error type; the
bdx module’s own API keeps the status code, because it is what has to
be sent back to the peer.
BtpMalformed
A BTP packet is malformed, or breaks one of §4.19.4.5’s reassembly rules: an Ending segment with no Beginning, a Beginning while another SDU is in flight, a reassembled length that does not match the Message Length it was promised.
Every one of these closes the BTP session. The protocol has no way to resynchronise, so continuing would mean reassembling two messages into one.
BtpSequence
A BTP sequence number did not increment by one, or an acknowledgement named a packet that was never sent or was already acknowledged — §4.19.4.6, §4.19.4.8. Also closes the session.
BtpTimeout
A BTP acknowledgement did not arrive within BTP_ACK_TIMEOUT (§4.19.4.8). The timer
doubles as BTP’s keep-alive, so this is also how a peer notices a remote stack that
has stopped answering.
Platform
The platform reported a failure.