msgError (36)

The msgError message is sent to inform a peer that a previously received message could not be processed. This is used for signaling application-level failures, such as malformed data or contextually invalid requests that are not covered by lower-level protocol rejections.

Core Data Types

Payload Structure

The payload provides context about the message that failed and the reason for the failure.

FieldData TypeMinMaxDescription
failedMessageIdIxiBytes1664The unique ID (StreamMessage.id) of the message that caused the error.
errorCodeIxiVarInt0*An application-defined integer code representing the type of error.
errorMessagestring0*Optional. A human-readable, UTF-8 encoded string describing the error in more detail.

Behavioral Notes

  • Error Reporting: A node should send this message when it receives a SpixiMessage that is syntactically valid but cannot be processed due to application logic (e.g., referencing a non-existent file, invalid parameters for a bot command).
  • Sender Action: The original sender of the failed message can use this information to notify the user that their action failed, or for logging and debugging purposes.
  • Usage: This message is intended for recoverable, application-level errors. It should not be used for protocol violations or decryption failures, which are handled at a lower level (e.g., with a rejected message).