Create Answer events when adding bolus to DB fails.
(cherry picked from commit 947ea4f)
This commit is contained in:
parent
6c9effd027
commit
435c4dee85
1 changed files with 11 additions and 0 deletions
|
@ -4,6 +4,9 @@ import android.os.SystemClock;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.crashlytics.android.answers.Answers;
|
||||||
|
import com.crashlytics.android.answers.CustomEvent;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -610,6 +613,10 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
||||||
Notification notification = new Notification(Notification.COMBO_PUMP_ALARM, MainApp.sResources.getString(R.string.combo_error_updating_treatment_record), Notification.URGENT);
|
Notification notification = new Notification(Notification.COMBO_PUMP_ALARM, MainApp.sResources.getString(R.string.combo_error_updating_treatment_record), Notification.URGENT);
|
||||||
MainApp.bus().post(new EventNewNotification(notification));
|
MainApp.bus().post(new EventNewNotification(notification));
|
||||||
}
|
}
|
||||||
|
Answers.getInstance().logCustom(new CustomEvent("ComboBolusToDbError")
|
||||||
|
.putCustomAttribute("buildversion", BuildConfig.BUILDVERSION)
|
||||||
|
.putCustomAttribute("version", BuildConfig.VERSION)
|
||||||
|
.putCustomAttribute("issue", "record with same timestamp existed and was overridden"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -617,6 +624,10 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
||||||
if (dbi.isSMB) {
|
if (dbi.isSMB) {
|
||||||
Notification notification = new Notification(Notification.COMBO_PUMP_ALARM, MainApp.sResources.getString(R.string.combo_error_updating_treatment_record), Notification.URGENT);
|
Notification notification = new Notification(Notification.COMBO_PUMP_ALARM, MainApp.sResources.getString(R.string.combo_error_updating_treatment_record), Notification.URGENT);
|
||||||
MainApp.bus().post(new EventNewNotification(notification));
|
MainApp.bus().post(new EventNewNotification(notification));
|
||||||
|
Answers.getInstance().logCustom(new CustomEvent("ComboBolusToDbError")
|
||||||
|
.putCustomAttribute("buildversion", BuildConfig.BUILDVERSION)
|
||||||
|
.putCustomAttribute("version", BuildConfig.VERSION)
|
||||||
|
.putCustomAttribute("issue", "adding record caused exception"));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue