mirror of
https://github.com/correl/mage.git
synced 2025-03-16 17:00:13 -09:00
Server: added stack info to logs for rollback error;
This commit is contained in:
parent
58566d2a7c
commit
b739694c93
2 changed files with 8 additions and 0 deletions
|
@ -1547,6 +1547,10 @@ public abstract class GameImpl implements Game {
|
||||||
}
|
}
|
||||||
this.fireErrorEvent("Game exception occurred: ", ex);
|
this.fireErrorEvent("Game exception occurred: ", ex);
|
||||||
|
|
||||||
|
// stack info
|
||||||
|
String info = this.getStack().stream().map(MageObject::toString).collect(Collectors.joining("\n"));
|
||||||
|
logger.info(String.format("\nStack before error %d: \n%s\n", this.getStack().size(), info));
|
||||||
|
|
||||||
// rollback game to prev state
|
// rollback game to prev state
|
||||||
GameState restoredState = restoreState(rollbackBookmark, "Game exception: " + ex.getMessage());
|
GameState restoredState = restoreState(rollbackBookmark, "Game exception: " + ex.getMessage());
|
||||||
rollbackBookmark = 0;
|
rollbackBookmark = 0;
|
||||||
|
|
|
@ -738,4 +738,8 @@ public class StackAbility extends StackObjectImpl implements Ability {
|
||||||
throw new UnsupportedOperationException("Not supported.");
|
throw new UnsupportedOperationException("Not supported.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue