not sure if it is intended or not but catching Throwable instead of Exception would also catch RuntimeExceptions from the JSONParser. Right now, anytime the app cannot connect to the server or times out, crashes the app process.
FATAL EXCEPTION: AsyncTask #1
Process: ...
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:300)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.lang.RuntimeException: java.net.ConnectException: failed to connect to ..../10.0.0.1 (port 443): connect failed: ETIMEDOUT (Connection timed out)
at com.github.javiersantos.appupdater.JSONParser.parse(JSONParser.java:53)
at com.github.javiersantos.appupdater.UtilsLibrary.getLatestAppVersion(UtilsLibrary.java:250)
at com.github.javiersantos.appupdater.UtilsAsync$LatestAppVersion.doInBackground(UtilsAsync.java:68)
at com.github.javiersantos.appupdater.UtilsAsync$LatestAppVersion.doInBackground(UtilsAsync.java:15)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
https://github.com/javiersantos/AppUpdater/blob/b97604f68c02b9b7df8f649789c0354b28a9da90/library/src/main/java/com/github/javiersantos/appupdater/UtilsAsync.java#L90
not sure if it is intended or not but catching Throwable instead of Exception would also catch RuntimeExceptions from the JSONParser. Right now, anytime the app cannot connect to the server or times out, crashes the app process.
FATAL EXCEPTION: AsyncTask #1 Process: ... java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:300) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) at java.util.concurrent.FutureTask.setException(FutureTask.java:222) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:841) Caused by: java.lang.RuntimeException: java.net.ConnectException: failed to connect to ..../10.0.0.1 (port 443): connect failed: ETIMEDOUT (Connection timed out) at com.github.javiersantos.appupdater.JSONParser.parse(JSONParser.java:53) at com.github.javiersantos.appupdater.UtilsLibrary.getLatestAppVersion(UtilsLibrary.java:250) at com.github.javiersantos.appupdater.UtilsAsync$LatestAppVersion.doInBackground(UtilsAsync.java:68) at com.github.javiersantos.appupdater.UtilsAsync$LatestAppVersion.doInBackground(UtilsAsync.java:15) at android.os.AsyncTask$2.call(AsyncTask.java:288) at java.util.concurrent.FutureTask.run(FutureTask.java:237)