add some Error handling

This commit is contained in:
Felix 2017-03-22 00:50:57 +01:00
parent 8eca371414
commit 8adc1ad0d6
6 changed files with 20 additions and 8 deletions

View file

@ -60,7 +60,8 @@ public class ConferencesBrowseFragment extends BrowseFragment {
@Override
public void onFailure(Call<Conferences> call, Throwable t) {
Log.d(TAG,"Error loading conferences",t);
t.printStackTrace();
}
});

View file

@ -5,6 +5,7 @@ import android.os.Handler;
import android.support.v17.leanback.app.VerticalGridFragment;
import android.support.v17.leanback.widget.ArrayObjectAdapter;
import android.support.v17.leanback.widget.VerticalGridPresenter;
import android.util.Log;
import java.util.Collections;
import java.util.List;
@ -24,7 +25,8 @@ import retrofit2.Response;
public class ConferencesGridFragment extends VerticalGridFragment {
private static final int NUM_COLUMNS = 5;
private final ArrayObjectAdapter mConferenceAdapter =
private static final String TAG = ConferencesGridFragment.class.getSimpleName();
private final ArrayObjectAdapter mConferenceAdapter =
new ArrayObjectAdapter(new CardPresenter());
private MediaCCCClient mMediaCCCClient;
@ -46,6 +48,8 @@ public class ConferencesGridFragment extends VerticalGridFragment {
@Override
public void onFailure(Call<Conferences> call, Throwable t) {
Log.d(TAG,"Error loading conferences",t);
t.printStackTrace();
}
});

View file

@ -99,7 +99,8 @@ public class EventsBrowseFragment extends BrowseFragment {
@Override
public void onFailure(Call<Conference> call, Throwable t) {
// TODO handle failure
Log.d(TAG,"Error loading conferences",t);
t.printStackTrace();
}
});
prepareBackgroundManager();

View file

@ -51,7 +51,8 @@ public class EventsDetailsFragment extends DetailsFragment {
@Override
public void onFailure(Call<Event> call, Throwable t) {
Log.d(TAG,"Error loading conferences",t);
t.printStackTrace();
}
});
@ -100,7 +101,8 @@ public class EventsDetailsFragment extends DetailsFragment {
@Override
public void onFailure(Call<Conference> call, Throwable t) {
Log.d(TAG,"Error loading conferences",t);
t.printStackTrace();
}
});

View file

@ -41,6 +41,7 @@ import android.support.v17.leanback.widget.PlaybackControlsRow.SkipPreviousActio
import android.support.v17.leanback.widget.PlaybackControlsRow.ThumbsDownAction;
import android.support.v17.leanback.widget.PlaybackControlsRow.ThumbsUpAction;
import android.support.v17.leanback.widget.PlaybackControlsRowPresenter;
import android.util.Log;
import android.widget.Toast;
import com.bumptech.glide.Glide;
@ -113,7 +114,8 @@ public class PlaybackOverlayFragment extends PlaybackFragment {
@Override
public void onFailure(Call<Event> call, Throwable t) {
Log.d(TAG,"Error loading conferences",t);
t.printStackTrace();
}
});
mHandler = new Handler();

View file

@ -121,7 +121,8 @@ public class VideoDetailsFragment extends DetailsFragment {
@Override
public void onFailure(Call<Event> call, Throwable t) {
Log.d(TAG,"Error loading conferences",t);
t.printStackTrace();
}
});
setupRelatedEvents();
@ -251,7 +252,8 @@ public class VideoDetailsFragment extends DetailsFragment {
@Override
public void onFailure(Call<Conference> call, Throwable t) {
Log.d(TAG,"Error loading conferences",t);
t.printStackTrace();
}
});
}