forked from github/wulkanowy-mirror
Log non-fatal exceptions with fabric (#80)
This commit is contained in:
parent
b22d95392b
commit
0708d84b98
@ -3,6 +3,8 @@ package io.github.wulkanowy.data.db.resources;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
|
||||
import com.crashlytics.android.Crashlytics;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.net.UnknownHostException;
|
||||
@ -41,6 +43,7 @@ public class AppResources implements ResourcesContract {
|
||||
@Override
|
||||
public String getErrorLoginMessage(Exception exception) {
|
||||
LogUtils.error(AppConstant.APP_NAME + " encountered a error", exception);
|
||||
Crashlytics.logException(exception);
|
||||
|
||||
if (exception instanceof CryptoException) {
|
||||
return resources.getString(R.string.encrypt_failed_text);
|
||||
@ -64,23 +67,23 @@ public class AppResources implements ResourcesContract {
|
||||
}
|
||||
|
||||
if (lesson.getIsAbsenceExcused()) {
|
||||
id = R.string.attendance_absence_excused;
|
||||
id = R.string.attendance_absence_excused;
|
||||
}
|
||||
|
||||
if (lesson.getIsAbsenceUnexcused()) {
|
||||
id = R.string.attendance_absence_unexcused;
|
||||
id = R.string.attendance_absence_unexcused;
|
||||
}
|
||||
|
||||
if (lesson.getIsExemption()) {
|
||||
id = R.string.attendance_exemption;
|
||||
id = R.string.attendance_exemption;
|
||||
}
|
||||
|
||||
if (lesson.getIsExcusedLateness()) {
|
||||
id = R.string.attendance_excused_lateness;
|
||||
id = R.string.attendance_excused_lateness;
|
||||
}
|
||||
|
||||
if (lesson.getIsUnexcusedLateness()) {
|
||||
id = R.string.attendance_unexcused_lateness;
|
||||
id = R.string.attendance_unexcused_lateness;
|
||||
}
|
||||
|
||||
return resources.getString(id);
|
||||
|
@ -4,6 +4,7 @@ import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
|
||||
import com.crashlytics.android.Crashlytics;
|
||||
import com.firebase.jobdispatcher.Constraint;
|
||||
import com.firebase.jobdispatcher.FirebaseJobDispatcher;
|
||||
import com.firebase.jobdispatcher.GooglePlayDriver;
|
||||
@ -75,6 +76,7 @@ public class SyncJob extends SimpleJobService {
|
||||
}
|
||||
return JobService.RESULT_SUCCESS;
|
||||
} catch (Exception e) {
|
||||
Crashlytics.logException(e);
|
||||
LogUtils.error("During background synchronization an error occurred", e);
|
||||
return JobService.RESULT_FAIL_RETRY;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user