Revert "Prevent crash"

This reverts commit 9b0c4e572e.
This commit is contained in:
M66B 2020-11-21 10:50:23 +01:00
parent a721196cdb
commit b7f5bfe55e
1 changed files with 7 additions and 13 deletions

View File

@ -130,7 +130,8 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
try { try {
onPreExecute(args); onPreExecute(args);
} catch (Throwable ex) { } catch (Throwable ex) {
error(args, ex); Log.e(ex);
onException(args, ex);
} }
future = getExecutor(context).submit(new Runnable() { future = getExecutor(context).submit(new Runnable() {
@ -194,7 +195,8 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
try { try {
onPostExecute(args); onPostExecute(args);
} catch (Throwable ex) { } catch (Throwable ex) {
error(args, ex); Log.e(ex);
onException(args, ex);
} finally { } finally {
try { try {
if (ex == null) { if (ex == null) {
@ -207,9 +209,10 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
onExecuted(args, (T) data); onExecuted(args, (T) data);
} else } else
error(args, ex); onException(args, ex);
} catch (Throwable ex) { } catch (Throwable ex) {
error(args, ex); Log.e(ex);
onException(args, ex);
} }
} }
} }
@ -218,15 +221,6 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
}); });
} }
void error(Bundle args, Throwable ex) {
try {
Log.e(ex);
onException(args, ex);
} catch (Throwable exex) {
Log.e(exex);
}
}
void cancel(Context context) { void cancel(Context context) {
if (future != null) if (future != null)
if (future.cancel(false)) { if (future.cancel(false)) {