refactor: improved some error messages/tests

This commit is contained in:
Oleg Agafonov 2023-06-16 07:32:21 +04:00
parent 7f8526192f
commit f0da749e0a
3 changed files with 11 additions and 7 deletions

View file

@ -637,7 +637,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
public SpellAbility getSecondFaceSpellAbility() {
Card secondFace = getSecondCardFace();
if (secondFace == null || secondFace.getClass().equals(getClass())) {
throw new IllegalArgumentException("Wrong code usage. getSecondFaceSpellAbility can only be used for double faced card (main side).");
throw new IllegalArgumentException("Wrong code usage: getSecondFaceSpellAbility can only be used for double faced card (main side), broken card: " + this.getName());
}
return secondFace.getSpellAbility();
}