diff --git a/Mage/src/main/java/mage/game/GameImpl.java b/Mage/src/main/java/mage/game/GameImpl.java index 925f2e5789..c07465a333 100644 --- a/Mage/src/main/java/mage/game/GameImpl.java +++ b/Mage/src/main/java/mage/game/GameImpl.java @@ -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; diff --git a/Mage/src/main/java/mage/game/stack/StackAbility.java b/Mage/src/main/java/mage/game/stack/StackAbility.java index adb78a1a7e..98df133060 100644 --- a/Mage/src/main/java/mage/game/stack/StackAbility.java +++ b/Mage/src/main/java/mage/game/stack/StackAbility.java @@ -738,4 +738,8 @@ public class StackAbility extends StackObjectImpl implements Ability { throw new UnsupportedOperationException("Not supported."); } + @Override + public String toString() { + return this.name; + } }