diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java index 450c3486..1ddcf537 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java @@ -900,7 +900,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter call, @NonNull Throwable t) { voteThingListener.onVoteThingFail(position); + Toast.makeText(context, "Network error " + "Body: " + t.getMessage(), Toast.LENGTH_LONG).show(); } }); } - public static void voteThing(final Retrofit retrofit, String accessToken, + public static void voteThing(Context context, final Retrofit retrofit, String accessToken, final VoteThingWithoutPositionListener voteThingWithoutPositionListener, final String fullName, final String point) { RedditAPI api = retrofit.create(RedditAPI.class); @@ -62,12 +67,14 @@ public class VoteThing { voteThingWithoutPositionListener.onVoteThingSuccess(); } else { voteThingWithoutPositionListener.onVoteThingFail(); + Toast.makeText(context, "Code " + response.code() + " Body: " + response.body(), Toast.LENGTH_LONG).show(); } } @Override public void onFailure(@NonNull Call call, @NonNull Throwable t) { voteThingWithoutPositionListener.onVoteThingFail(); + Toast.makeText(context, "Network error " + "Body: " + t.getMessage(), Toast.LENGTH_LONG).show(); } }); }