mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00: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);
|
||||
|
||||
// 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
|
||||
GameState restoredState = restoreState(rollbackBookmark, "Game exception: " + ex.getMessage());
|
||||
rollbackBookmark = 0;
|
||||
|
|
|
@ -738,4 +738,8 @@ public class StackAbility extends StackObjectImpl implements Ability {
|
|||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue