接口 SubProtocolErrorHandler<P>
- 所有已知实现类:
StompSubProtocolErrorHandler
public interface SubProtocolErrorHandler<P>
A contract for handling sub-protocol errors sent to clients.- 从以下版本开始:
- 4.2
- 作者:
- Rossen Stoyanchev
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 Message<P>
handleClientMessageProcessingError(Message<P> clientMessage, Throwable ex)
Handle errors thrown while processing client messages providing an opportunity to prepare the error message or to prevent one from being sent.Message<P>
handleErrorMessageToClient(Message<P> errorMessage)
Handle errors sent from the server side to clients, e.g. errors from the"broke relay"
because connectivity failed or the external broker sent an error message, etc.
方法详细资料
handleClientMessageProcessingError
Message<P> handleClientMessageProcessingError(Message<P> clientMessage, Throwable ex)
Handle errors thrown while processing client messages providing an opportunity to prepare the error message or to prevent one from being sent.Note that the STOMP protocol requires a server to close the connection after sending an ERROR frame. To prevent an ERROR frame from being sent, a handler could return
null
and send a notification message through the broker instead, e.g. via a user destination.- 参数:
clientMessage
- the client message related to the error, possiblynull
if error occurred while parsing a WebSocket messageex
- the cause for the error, nevernull
- 返回:
- the error message to send to the client, or
null
in which case no message will be sent.
handleErrorMessageToClient
Message<P> handleErrorMessageToClient(Message<P> errorMessage)
Handle errors sent from the server side to clients, e.g. errors from the"broke relay"
because connectivity failed or the external broker sent an error message, etc.- 参数:
errorMessage
- the error message, nevernull
- 返回:
- the error message to send to the client, or
null
in which case no message will be sent.