Calling listener in case of erorr

This commit is contained in:
Nelson R. Perez 2016-12-22 12:05:16 -05:00
parent 4f64391e00
commit e9047b55ce

View file

@ -137,12 +137,14 @@ public class GetRelativeAccountHistory extends WebSocketAdapter {
@Override @Override
public void onError(WebSocket websocket, WebSocketException cause) throws Exception { public void onError(WebSocket websocket, WebSocketException cause) throws Exception {
System.out.println("onError. Msg: "+cause.getMessage()); System.out.println("onError. Msg: "+cause.getMessage());
mListener.onError(new BaseResponse.Error(cause.getMessage()));
websocket.disconnect(); websocket.disconnect();
} }
@Override @Override
public void handleCallbackError(WebSocket websocket, Throwable cause) throws Exception { public void handleCallbackError(WebSocket websocket, Throwable cause) throws Exception {
System.out.println("handleCallbackError. Msg: "+cause.getMessage()); System.out.println("handleCallbackError. Msg: "+cause.getMessage());
mListener.onError(new BaseResponse.Error(cause.getMessage()));
websocket.disconnect(); websocket.disconnect();
} }
} }