Surround library crash with try-catch

This commit is contained in:
Alex Sytnyk 2018-05-21 12:02:21 +03:00
parent 4fe57fdfd1
commit 007f9fb51b

View file

@ -126,7 +126,11 @@ public abstract class AbstractPrologCommandPlayer implements CommandPlayer, Stat
@Override
public void stateChanged(ApplicationMode change) {
if(prologSystem != null) {
try {
prologSystem.getTheoryManager().retract(new Struct("appMode", new Var()));
} catch (Exception e) {
log.error("Retract error: ", e);
}
prologSystem.getTheoryManager()
.assertA(
new Struct("appMode", new Struct(ctx.getSettings().APPLICATION_MODE.get().getStringKey()