on_error Event
Fired when a class or protocol error occurs.
Syntax
class STOMPErrorEventParams(object): @property def error_code() -> int: ... @property def description() -> str: ... @property def data() -> bytes: ... # In class STOMP: @property def on_error() -> Callable[[STOMPErrorEventParams], None]: ... @on_error.setter def on_error(event_hook: Callable[[STOMPErrorEventParams], None]) -> None: ...
Remarks
The on_error event is fired in case of exceptional conditions during message processing. Normally the class fails with an error.
ErrorCode contains an error code and Description contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the Error Codes section.
STOMP Protocol Errors
The class will fire the on_error event anytime the server reports a STOMP protocol error (i.e., the class receives an ERROR frame).When this occurs, ErrorCode will be 600, Description will reflect the value of the ERROR frame's message header, and Data will contain the body of the ERROR frame (if one is present).
The ErrorHeaders configuration setting will also be populated with the raw headers from the ERROR frame for the duration of the on_error event handler.