From 36dcae63b3b37f34d93789ca87def42c71df2b8c Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Fri, 12 Jan 2018 21:28:10 +0400 Subject: [PATCH] For last fix --- Mage/src/main/java/mage/cards/CardImpl.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Mage/src/main/java/mage/cards/CardImpl.java b/Mage/src/main/java/mage/cards/CardImpl.java index 4c9aaf5397..d73dd8e6bb 100644 --- a/Mage/src/main/java/mage/cards/CardImpl.java +++ b/Mage/src/main/java/mage/cards/CardImpl.java @@ -28,10 +28,8 @@ package mage.cards; import java.lang.reflect.Constructor; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; +import java.util.*; + import mage.MageObject; import mage.MageObjectImpl; import mage.Mana; @@ -196,6 +194,10 @@ public abstract class CardImpl extends MageObjectImpl implements Card { } public static Card createCard(Class clazz, CardSetInfo setInfo) { + return createCard(clazz, setInfo, null); + } + + public static Card createCard(Class clazz, CardSetInfo setInfo, List errorList) { try { Card card; if (setInfo == null) { @@ -207,7 +209,11 @@ public abstract class CardImpl extends MageObjectImpl implements Card { } return card; } catch (Exception e) { - logger.fatal("Error loading card: " + clazz.getCanonicalName(), e); + String err = "Error loading card: " + clazz.getCanonicalName(); + if (errorList != null) { + errorList.add(err); + } + logger.fatal(err, e); return null; } }