protected void onError(Channel channel, Throwable throwable) { log.error(throwable, "Websocket connection error"); channel.onError(connectMessage, new RuntimeException("Websocket connection error", throwable)); getStatusHandler().handleException(new TransportException("Websocket connection error: " + throwable.getMessage())); } }
protected void onError(Channel channel, Throwable throwable) { log.error(throwable, "Websocket connection error"); channel.onError(connectMessage, new RuntimeException("Websocket connection error", throwable)); getStatusHandler().handleException(new TransportException("Websocket connection error: " + throwable.getMessage())); } }
public void completed(HttpResponse response) { if (!message.isConnect()) getStatusHandler().handleIO(false); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { channel.onError(message, new TransportHttpStatusException( response.getStatusLine().getStatusCode(), response.getStatusLine().getReasonPhrase()) ); return; } InputStream is = null; try { is = response.getEntity().getContent(); channel.onMessage(is); } catch (Exception e) { getStatusHandler().handleException(new TransportIOException(message, "Could not deserialize message", e)); } finally { if (is != null) try { is.close(); } catch (Exception e) { } } }
channel.onError(message, new TransportHttpStatusException( response.getStatusLine().getStatusCode(), response.getStatusLine().getReasonPhrase())
channel.onError(message, new TransportHttpStatusException( response.getStatusLine().getStatusCode(), response.getStatusLine().getReasonPhrase())
public void failed(Exception e) { if (!message.isConnect()) getStatusHandler().handleIO(false); channel.onError(message, e); getStatusHandler().handleException(new TransportIOException(message, "Request failed", e)); }
public void failed(Exception e) { if (!message.isConnect()) getStatusHandler().handleIO(false); if (message.isDisconnect()) { channel.onDisconnect(); return; } channel.onError(message, e); getStatusHandler().handleException(new TransportIOException(message, "Request failed", e)); }
public void failed(Exception e) { if (!message.isConnect()) getStatusHandler().handleIO(false); if (message.isDisconnect()) { channel.onDisconnect(); return; } channel.onError(message, e); getStatusHandler().handleException(new TransportIOException(message, "Request failed", e)); }
stop(); channel.onError(transportMessage, new RuntimeException(message + " (code=" + closeCode + ")")); getStatusHandler().handleException(new TransportException("Transport disconnected")); return;
channel.onError(connectMessage, new RuntimeException(message + " (code=" + closeCode + ")")); getStatusHandler().handleException(new TransportException("Transport disconnected")); return;
channel.onError(connectMessage, new RuntimeException(message + " (code=" + closeCode + ")")); getStatusHandler().handleException(new TransportException("Transport disconnected")); return;