I want to know what is the difference between onFailure and when response is not successful in retrofit
call.enqueue(new Callback<Void>() {
@Override
public void onResponse(Call<Void> call, Response<Void> response) {
if (!response.isSuccessful()){
*1
}
}
@Override
public void onFailure(Call<Void> call, Throwable t) {
*2
}
});
When will be on *1 and *2 in the above callback