org.eclipse.jetty.websocket.api.annotations.OnWebSocketError Java Examples

The following examples show how to use org.eclipse.jetty.websocket.api.annotations.OnWebSocketError. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JettyWebSocketHandlerAdapter.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@OnWebSocketError
public void onWebSocketError(Throwable cause) {
	try {
		this.webSocketHandler.handleTransportError(this.wsSession, cause);
	}
	catch (Throwable ex) {
		ExceptionWebSocketHandlerDecorator.tryCloseWithError(this.wsSession, ex, logger);
	}
}
 
Example #2
Source File: WebSocketImpl.java    From BIMserver with GNU Affero General Public License v3.0 5 votes vote down vote up
@OnWebSocketError
public void onError(Session session, Throwable error) {
	if (error instanceof EofException) {
		LOGGER.error("EofException for " + session.getRemoteAddress());
	} else {
		LOGGER.error("", error);
	}
}
 
Example #3
Source File: ConsoleLogSocket.java    From gocd with Apache License 2.0 5 votes vote down vote up
@OnWebSocketError
public void onError(Throwable error) {
    LOGGER.error("{} closing session because an error was thrown", sessionName(), error);
    try {
        close(StatusCode.SERVER_ERROR, error.getMessage());
    } finally {
        socketHealthService.deregister(this);
    }
}
 
Example #4
Source File: XmppWebSocket.java    From Openfire with Apache License 2.0 5 votes vote down vote up
@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);
    }
}
 
Example #5
Source File: WebSocketClientSource.java    From datacollector with Apache License 2.0 5 votes vote down vote up
@OnWebSocketError
public void onWebSocketError(Throwable cause) {
  LOG.warn("WebSocket Error", cause);
  try {
    connectToWebSocket();
  } catch (Exception e) {
    LOG.error(Errors.WEB_SOCKET_01.getMessage(), e.toString(), e);
  }
}
 
Example #6
Source File: JettyWebSocketHandlerAdapter.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@OnWebSocketError
public void onWebSocketError(Throwable cause) {
	try {
		this.webSocketHandler.handleTransportError(this.wsSession, cause);
	}
	catch (Throwable ex) {
		ExceptionWebSocketHandlerDecorator.tryCloseWithError(this.wsSession, ex, logger);
	}
}
 
Example #7
Source File: JettyWebSocketHandlerAdapter.java    From java-technology-stack with MIT License 5 votes vote down vote up
@OnWebSocketError
public void onWebSocketError(Throwable cause) {
	try {
		this.webSocketHandler.handleTransportError(this.wsSession, cause);
	}
	catch (Throwable ex) {
		ExceptionWebSocketHandlerDecorator.tryCloseWithError(this.wsSession, ex, logger);
	}
}
 
Example #8
Source File: EgressMobiusHandler.java    From warp10-platform with Apache License 2.0 4 votes vote down vote up
@OnWebSocketError        
public void onWebSocketError(Session session, Throwable t) {
  mobius.removeSession(session);
}
 
Example #9
Source File: JettyWebSocketHandlerAdapter.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@OnWebSocketError
public void onWebSocketError(Throwable cause) {
	if (this.delegateSession != null) {
		this.delegateSession.handleError(cause);
	}
}
 
Example #10
Source File: LogWebSocketHandler.java    From android-uiconductor with Apache License 2.0 4 votes vote down vote up
@OnWebSocketError
public void onError(Throwable t) {
  logger.severe(t.getMessage());
}
 
Example #11
Source File: MinicapWebSocketHandler.java    From android-uiconductor with Apache License 2.0 4 votes vote down vote up
@OnWebSocketError
public void onError(Throwable t) {
  System.out.println("Error: " + t.getMessage());
}
 
Example #12
Source File: MyWebSocketHandler.java    From opensim-gui with Apache License 2.0 4 votes vote down vote up
@OnWebSocketError
public void onError(Throwable t) {
    System.out.println("Error: " + t.getMessage());
}
 
Example #13
Source File: VisWebSocket.java    From opensim-gui with Apache License 2.0 4 votes vote down vote up
@OnWebSocketError
 public void onError (Session peer, Throwable er) {
    System.out.println("onError:"+er.getMessage());
}
 
Example #14
Source File: JettyWebSocketHandlerAdapter.java    From java-technology-stack with MIT License 4 votes vote down vote up
@OnWebSocketError
public void onWebSocketError(Throwable cause) {
	if (this.delegateSession != null) {
		this.delegateSession.handleError(cause);
	}
}
 
Example #15
Source File: ServerSocket.java    From java-docs-samples with Apache License 2.0 4 votes vote down vote up
@OnWebSocketError
public void onWebSocketError(Throwable cause) {
  logger.severe("Websocket error : " + cause.getMessage());
}
 
Example #16
Source File: EgressInteractiveHandler.java    From warp10-platform with Apache License 2.0 4 votes vote down vote up
@OnWebSocketError        
public void onWebSocketError(Session session, Throwable t) {}
 
Example #17
Source File: BinaryExchangeSocket.java    From conga with Apache License 2.0 4 votes vote down vote up
@OnWebSocketError
public void OnError(Session session, Throwable error) {
  // todo log errors
  error.printStackTrace();
}
 
Example #18
Source File: TestWebSocket.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
@OnWebSocketError
public void methodName(Session session, Throwable error) {
  this.error = error;
  connect.countDown();
}
 
Example #19
Source File: SocketServlet.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
@OnWebSocketError
public void onError(Session session, Throwable error) {
  logger.error("Failure in web socket handling.", error);
}
 
Example #20
Source File: ObservableSocket.java    From jobson with Apache License 2.0 4 votes vote down vote up
@OnWebSocketError
public void onWebSocketError(Session session, Throwable ex) {
    log.debug(ex.getMessage());
    this.eventsSubscription.dispose();
}
 
Example #21
Source File: WebSocketConnection.java    From jmeter-bzm-plugins with Apache License 2.0 4 votes vote down vote up
@OnWebSocketError
public void onError(Throwable cause){
	log.error("Error " + cause.getMessage());
}
 
Example #22
Source File: TextExchangeSocket.java    From conga with Apache License 2.0 4 votes vote down vote up
@OnWebSocketError
public void OnError(Session session, Throwable error) {
  // todo log errors
  error.printStackTrace();
}
 
Example #23
Source File: WebsocketAPI.java    From cineast with MIT License 2 votes vote down vote up
/**
 * TODO: Handle errors properly.
 *
 * @param session
 * @param error
 */
@OnWebSocketError
public void onWebSocketException(Session session, Throwable error) {
    LOGGER.fatal("An unhandled error occurred during message handling: {}", LogHelper.getStackTrace(error));
}