logs exception

This commit is contained in:
Mariotaku Lee 2017-02-07 23:39:51 +08:00
parent 8623368292
commit 8e83ae326a
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
2 changed files with 8 additions and 0 deletions

View File

@ -30,6 +30,8 @@ import android.annotation.TargetApi;
import android.app.job.JobParameters;
import android.os.Build;
import org.mariotaku.twidere.util.Analyzer;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@ -69,9 +71,11 @@ public class JobServiceSupport {
return false;
} catch (IllegalAccessException e) {
// This shouldn't happen, skip
Analyzer.Companion.logException(e);
return false;
} catch (InvocationTargetException e) {
// Internal error, skip
Analyzer.Companion.logException(e);
return false;
}
}
@ -85,9 +89,11 @@ public class JobServiceSupport {
return true;
} catch (NoSuchFieldException e) {
// Framework version mismatch, skip
Analyzer.Companion.logException(e);
return false;
} catch (IllegalAccessException e) {
// This shouldn't happen, skip
Analyzer.Companion.logException(e);
return false;
}
}

View File

@ -27,6 +27,7 @@ import android.os.Build
import org.mariotaku.kpreferences.KPreferences
import org.mariotaku.twidere.annotation.AutoRefreshType
import org.mariotaku.twidere.constant.autoRefreshCompatibilityModeKey
import org.mariotaku.twidere.util.Analyzer
import org.mariotaku.twidere.util.TaskServiceRunner
import org.mariotaku.twidere.util.dagger.GeneralComponentHelper
import org.mariotaku.twidere.util.support.JobServiceSupport
@ -64,6 +65,7 @@ class JobTaskService : JobService() {
}
} catch (e: Exception) {
// Swallow any possible exceptions
Analyzer.logException(e)
}
return false
}