From 100570b15fff82728e64276b08c9ffdf901c63ff Mon Sep 17 00:00:00 2001 From: ifoche Date: Wed, 9 Dec 2015 01:08:24 +0100 Subject: [PATCH] survey state change when imported questions blocked by Exception --- .../java/org/eyeseetea/malariacare/network/PushClient.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/org/eyeseetea/malariacare/network/PushClient.java b/app/src/main/java/org/eyeseetea/malariacare/network/PushClient.java index 9fa144fcb..2f38bd7cc 100644 --- a/app/src/main/java/org/eyeseetea/malariacare/network/PushClient.java +++ b/app/src/main/java/org/eyeseetea/malariacare/network/PushClient.java @@ -101,6 +101,9 @@ public PushResult push() { //data = prepareDataElements(data, controlData.get("")); data = prepareDataElements(data, null); pushResult = new PushResult(pushData(data)); + if (pushResult.getImported().equals("0")){ + throw new Exception("Server was not able to import the data. Please, report to the server admin."); + } if(pushResult.isSuccessful()){ //TODO: This should be removed once DHIS bug is solved //pushControlDataElements(controlData);