Retry Get pulse log command in case of failure

This commit is contained in:
Bart Sopers 2019-12-27 13:51:20 -05:00
parent 6d377d7b6a
commit 10ab880e28

View file

@ -90,13 +90,19 @@ public class OmnipodUITask {
break; break;
case GetPodPulseLog: case GetPodPulseLog:
try { // This command is very error prone, so retry a few times if it fails
returnDataObject = communicationManager.readPulseLog(); // Can take some time, but that's ok since this is a very specific feature for experts
} catch(Exception ex) { // And will not be used by normal users
if(isLogEnabled()) { for(int i = 0; 3 > i; i++) {
LOG.warn("Failed to retrieve pulse log", ex); try {
returnDataObject = communicationManager.readPulseLog();
break;
} catch (Exception ex) {
if (isLogEnabled()) {
LOG.warn("Failed to retrieve pulse log", ex);
}
returnDataObject = null;
} }
returnDataObject = null;
} }
break; break;