From 45c6a54e48ca09dc0762ac0a26e678abd239bf3a Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sat, 25 Jan 2020 21:52:03 +0100 Subject: [PATCH] Upload queue id fix --- .../java/info/nightscout/androidaps/db/DatabaseHelper.java | 6 +----- .../androidaps/plugins/general/nsclient/UploadQueue.java | 6 +++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java index dd93397ac3..073f21e708 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java +++ b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java @@ -550,12 +550,8 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper { // ------------- DbRequests handling ------------------- - public void create(DbRequest dbr) { - try { + public void create(DbRequest dbr) throws SQLException { getDaoDbRequest().create(dbr); - } catch (SQLException e) { - log.error("Unhandled exception", e); - } } public int delete(DbRequest dbr) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/UploadQueue.java b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/UploadQueue.java index 0fd3dcc345..f513f12756 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/UploadQueue.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/UploadQueue.java @@ -52,7 +52,11 @@ public class UploadQueue { } catch (Exception e) { log.error("Unhandled exception", e); dbr.nsClientID += "1"; - MainApp.getDbHelper().create(dbr); + try { + MainApp.getDbHelper().create(dbr); + } catch (Exception e1) { + log.error("Unhandled exception", e1); + } } NSClientPlugin plugin = NSClientPlugin.getPlugin(); if (plugin != null) {