mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-22 14:47:29 +00:00
why does java mandates catching exception bruh
This commit is contained in:
parent
ac770877ee
commit
5952bf4b60
@ -10,7 +10,7 @@ android {
|
|||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
|
|
||||||
versionCode 27
|
versionCode 27
|
||||||
versionName '16.6-a5'
|
versionName '16.6-a6'
|
||||||
|
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package awais.instagrabber.adapters;
|
package awais.instagrabber.adapters;
|
||||||
|
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@ -20,10 +21,14 @@ import java.net.HttpURLConnection;
|
|||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import awais.instagrabber.BuildConfig;
|
||||||
import awais.instagrabber.R;
|
import awais.instagrabber.R;
|
||||||
import awais.instagrabber.adapters.viewholder.PostViewHolder;
|
import awais.instagrabber.adapters.viewholder.PostViewHolder;
|
||||||
import awais.instagrabber.models.PostModel;
|
import awais.instagrabber.models.PostModel;
|
||||||
import awais.instagrabber.models.enums.MediaItemType;
|
import awais.instagrabber.models.enums.MediaItemType;
|
||||||
|
import awaisomereport.LogCollector;
|
||||||
|
|
||||||
|
import static awais.instagrabber.utils.Utils.logCollector;
|
||||||
|
|
||||||
public final class PostsAdapter extends RecyclerView.Adapter<PostViewHolder> {
|
public final class PostsAdapter extends RecyclerView.Adapter<PostViewHolder> {
|
||||||
private final ArrayList<PostModel> postModels;
|
private final ArrayList<PostModel> postModels;
|
||||||
@ -80,11 +85,18 @@ public final class PostsAdapter extends RecyclerView.Adapter<PostViewHolder> {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onLoadFailed(@Nullable final GlideException e, final Object model, final Target<Drawable> target, final boolean isFirstResource) {
|
public boolean onLoadFailed(@Nullable final GlideException e, final Object model, final Target<Drawable> target, final boolean isFirstResource) {
|
||||||
holder.progressView.setVisibility(View.GONE);
|
holder.progressView.setVisibility(View.GONE);
|
||||||
|
try {
|
||||||
final HttpURLConnection conn = (HttpURLConnection) new URL(postModel.getDisplayUrl()).openConnection();
|
final HttpURLConnection conn = (HttpURLConnection) new URL(postModel.getDisplayUrl()).openConnection();
|
||||||
conn.setUseCaches(false);
|
conn.setUseCaches(false);
|
||||||
conn.connect();
|
conn.connect();
|
||||||
if (conn.getResponseCode() != HttpURLConnection.HTTP_GONE)
|
if (conn.getResponseCode() != HttpURLConnection.HTTP_GONE)
|
||||||
glideRequestManager.load(postModel.getDisplayUrl()).into(holder.postImage);
|
glideRequestManager.load(postModel.getDisplayUrl()).into(holder.postImage);
|
||||||
|
}
|
||||||
|
catch (Exception urle) {
|
||||||
|
if (logCollector != null)
|
||||||
|
logCollector.appendException(urle, LogCollector.LogFile.ASYNC_POST_FETCHER, "doInBackground");
|
||||||
|
if (BuildConfig.DEBUG) Log.e("AWAISKING_APP", "", urle);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}).into(holder.postImage);
|
}).into(holder.postImage);
|
||||||
|
Loading…
Reference in New Issue
Block a user