Search in sources :

Example 1 with OnWebSocketError

use of org.eclipse.jetty.websocket.api.annotations.OnWebSocketError in project Openfire by igniterealtime.

the class XmppWebSocket method onError.

@OnWebSocketError
public void onError(Throwable error) {
    Log.error("Error detected; session: " + wsSession, error);
    closeStream(new StreamError(StreamError.Condition.internal_server_error));
    try {
        if (wsSession != null) {
            wsSession.disconnect();
        }
    } catch (Exception e) {
        Log.error("Error disconnecting websocket", e);
    }
}
Also used : StreamError(org.xmpp.packet.StreamError) IOException(java.io.IOException) UnknownStanzaException(org.jivesoftware.openfire.multiplex.UnknownStanzaException) OnWebSocketError(org.eclipse.jetty.websocket.api.annotations.OnWebSocketError)

Aggregations

IOException (java.io.IOException)1 OnWebSocketError (org.eclipse.jetty.websocket.api.annotations.OnWebSocketError)1 UnknownStanzaException (org.jivesoftware.openfire.multiplex.UnknownStanzaException)1 StreamError (org.xmpp.packet.StreamError)1