Logging blueprint id for a card not found

This commit is contained in:
marcin.sciesinski
2019-09-16 23:16:45 -07:00
parent 88436c8152
commit eab0650f3f
2 changed files with 8 additions and 7 deletions

View File

@@ -1,4 +1,7 @@
package com.gempukku.lotro.game;
public class CardNotFoundException extends Exception {
public CardNotFoundException(String blueprint) {
super(blueprint);
}
}

View File

@@ -55,7 +55,7 @@ public class LotroCardBlueprintLibrary {
private void initCardSets(CardSets cardSets) {
for (SetDefinition setDefinition : cardSets.getSetDefinitions().values()) {
if (setDefinition.hasFlag("needsLoading")) {
// if (setDefinition.hasFlag("needsLoading")) {
logger.debug("Loading set " + setDefinition.getSetId());
final Set<String> allCards = setDefinition.getAllCards();
for (String blueprintId : allCards) {
@@ -70,7 +70,7 @@ public class LotroCardBlueprintLibrary {
}
}
}
}
// }
}
}
@@ -220,16 +220,14 @@ public class LotroCardBlueprintLibrary {
LotroCardBlueprint blueprint = null;
try {
blueprint = tryLoadingFromPackage(packageName, setNumber, cardNumber);
} catch (IllegalAccessException e) {
throw new CardNotFoundException();
} catch (InstantiationException e) {
throw new CardNotFoundException();
} catch (IllegalAccessException | InstantiationException e) {
throw new CardNotFoundException(blueprintId);
}
if (blueprint != null)
return blueprint;
}
throw new CardNotFoundException();
throw new CardNotFoundException(blueprintId);
}
private LotroCardBlueprint tryLoadingFromPackage(String packageName, String setNumber, String cardNumber) throws IllegalAccessException, InstantiationException {