From 939cc56951fadfb4ca612b4432dbeb931b5d19d9 Mon Sep 17 00:00:00 2001 From: krtkush Date: Sun, 18 Nov 2018 19:18:16 +0530 Subject: [PATCH] Pull request changes v2. --- .../schabi/newpipe/CheckForNewAppVersionTask.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java index 5c55ee8ba..cd41ac07e 100644 --- a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java @@ -89,7 +89,6 @@ public class CheckForNewAppVersionTask extends AsyncTask { return response.body().string(); } catch (IOException ex) { - ErrorActivity.reportError(app, ex, null, null, ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none", "app update API fail", R.string.app_ui_crash)); @@ -117,7 +116,6 @@ public class CheckForNewAppVersionTask extends AsyncTask { compareAppVersionAndShowNotification(versionName, apkLocationUrl, versionCode); } catch (JSONException ex) { - ex.printStackTrace(); ErrorActivity.reportError(app, ex, null, null, ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none", "could not parse app update JSON data", R.string.app_ui_crash)); @@ -172,8 +170,10 @@ public class CheckForNewAppVersionTask extends AsyncTask { try { packageInfo = pm.getPackageInfo(packageName, flags); - } catch (PackageManager.NameNotFoundException e) { - e.printStackTrace(); + } catch (PackageManager.NameNotFoundException ex) { + ErrorActivity.reportError(app, ex, null, null, + ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none", + "Could not find package info", R.string.app_ui_crash)); } Signature[] signatures = packageInfo.signatures; @@ -186,8 +186,10 @@ public class CheckForNewAppVersionTask extends AsyncTask { try { cf = CertificateFactory.getInstance("X509"); c = (X509Certificate) cf.generateCertificate(input); - } catch (CertificateException e) { - e.printStackTrace(); + } catch (CertificateException ex) { + ErrorActivity.reportError(app, ex, null, null, + ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none", + "Certificate error", R.string.app_ui_crash)); } String hexString = null;