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
public void onError(WebSocket websocket, WebSocketException cause) throws Exception {
System.out.println("onError. Msg: "+cause.getMessage());
mListener.onError(new BaseResponse.Error(cause.getMessage()));
websocket.disconnect();
}
@Override
public void handleCallbackError(WebSocket websocket, Throwable cause) throws Exception {
System.out.println("handleCallbackError. Msg: "+cause.getMessage());
mListener.onError(new BaseResponse.Error(cause.getMessage()));
websocket.disconnect();
}
}