mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Better error message to debug an exception.
This commit is contained in:
@@ -92,8 +92,6 @@ public final class AbilityFactory {
|
|||||||
* @return a {@link forge.game.spellability.SpellAbility} object.
|
* @return a {@link forge.game.spellability.SpellAbility} object.
|
||||||
*/
|
*/
|
||||||
public static final SpellAbility getAbility(final String abString, final Card hostCard) {
|
public static final SpellAbility getAbility(final String abString, final Card hostCard) {
|
||||||
|
|
||||||
|
|
||||||
Map<String, String> mapParams;
|
Map<String, String> mapParams;
|
||||||
try {
|
try {
|
||||||
mapParams = AbilityFactory.getMapParams(abString);
|
mapParams = AbilityFactory.getMapParams(abString);
|
||||||
@@ -104,9 +102,10 @@ public final class AbilityFactory {
|
|||||||
|
|
||||||
// parse universal parameters
|
// parse universal parameters
|
||||||
AbilityRecordType type = AbilityRecordType.getRecordType(mapParams);
|
AbilityRecordType type = AbilityRecordType.getRecordType(mapParams);
|
||||||
if( null == type )
|
if (null == type) {
|
||||||
throw new RuntimeException("AbilityFactory : getAbility -- no API in " + hostCard.getName());
|
String source = hostCard.getName().isEmpty() ? abString : hostCard.getName();
|
||||||
|
throw new RuntimeException("AbilityFactory : getAbility -- no API in " + source);
|
||||||
|
}
|
||||||
return getAbility(type, type.getApiTypeOf(mapParams), mapParams, parseAbilityCost(hostCard, mapParams, type), hostCard);
|
return getAbility(type, type.getApiTypeOf(mapParams), mapParams, parseAbilityCost(hostCard, mapParams, type), hostCard);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user