Some times the json service return erros and/or wrong serialized data.
You need to be able to handle that unexpected response in the onFailure CallBack.
api.getProdByName(name, new Callback() {
@Override
public void onFailure(Exception ex) {
//some nasty failure happened here
}
@Override
public void onResponse(Response<Response> response) {
}
});
Some times the json service return erros and/or wrong serialized data. You need to be able to handle that unexpected response in the onFailure CallBack.
api.getProdByName(name, new Callback() {