I am using koush ion for service hit in my project as written below
Ion.asString().setCallback(new FutureCallback<String>() {
@Override
public void onCompleted(Exception error, String result){}
}
During API hit there can be success as well as error. If success comes I will parse data and display it, but in case of error I want to know: How can I get different exception type and show proper message to user?
In case of exception there can be many reasons like server is down, timeout, no network and many others. I want to know how can be catch each and every exception properly and show a proper message to user.