Return original exception in case retry fails as well.
This commit is contained in:
parent
d0d3e46e03
commit
e45acab420
1 changed files with 10 additions and 9 deletions
|
@ -390,7 +390,7 @@ public class ComboPlugin implements PluginBase, PumpInterface {
|
||||||
MainApp.bus().post(new EventComboPumpUpdateGUI());
|
MainApp.bus().post(new EventComboPumpUpdateGUI());
|
||||||
|
|
||||||
CommandResult commandResult = ruffyScripter.runCommand(command);
|
CommandResult commandResult = ruffyScripter.runCommand(command);
|
||||||
if (commandResult.exception != null) {
|
if (!commandResult.success && commandResult.exception != null) {
|
||||||
log.error("CommandResult has exception, rebinding ruffy service", commandResult.exception);
|
log.error("CommandResult has exception, rebinding ruffy service", commandResult.exception);
|
||||||
|
|
||||||
unbindRuffyService();
|
unbindRuffyService();
|
||||||
|
@ -400,13 +400,14 @@ public class ComboPlugin implements PluginBase, PumpInterface {
|
||||||
|
|
||||||
if (ruffyScripter == null) {
|
if (ruffyScripter == null) {
|
||||||
log.error("Rebinding failed");
|
log.error("Rebinding failed");
|
||||||
}
|
} else if (!commandResult.enacted && !(command instanceof BolusCommand)) {
|
||||||
|
|
||||||
// retry command, but make sure it wasn't enacted and don't retry
|
// retry command, but make sure it wasn't enacted and don't retry
|
||||||
// bolus commands (user is interacting with AAPS right now so he can
|
// bolus commands (user is interacting with AAPS right now so he can
|
||||||
// deal with it and we don't want to deliver a bolus twice
|
// deal with it and we don't want to deliver a bolus twice)
|
||||||
if (!commandResult.enacted && !(command instanceof BolusCommand)) {
|
CommandResult retriedCommandResult = ruffyScripter.runCommand(command);
|
||||||
commandResult = ruffyScripter.runCommand(command) ;
|
if (retriedCommandResult.success) {
|
||||||
|
commandResult = retriedCommandResult;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue