mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Merge branch 'sentry2019Breadcrumbs' into 'master'
Sentry: add more Breadcumbs See merge request core-developers/forge!1274
This commit is contained in:
@@ -28,6 +28,8 @@ import forge.game.cost.Cost;
|
|||||||
import forge.game.spellability.*;
|
import forge.game.spellability.*;
|
||||||
import forge.game.zone.ZoneType;
|
import forge.game.zone.ZoneType;
|
||||||
import forge.util.FileSection;
|
import forge.util.FileSection;
|
||||||
|
import io.sentry.Sentry;
|
||||||
|
import io.sentry.event.BreadcrumbBuilder;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -130,7 +132,16 @@ public final class AbilityFactory {
|
|||||||
String source = state.getName().isEmpty() ? abString : state.getName();
|
String source = state.getName().isEmpty() ? abString : state.getName();
|
||||||
throw new RuntimeException("AbilityFactory : getAbility -- no API in " + source + ": " + abString);
|
throw new RuntimeException("AbilityFactory : getAbility -- no API in " + source + ": " + abString);
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
return getAbility(mapParams, type, state, parent);
|
return getAbility(mapParams, type, state, parent);
|
||||||
|
} catch (Error | Exception ex) {
|
||||||
|
String msg = "AbilityFactory:getAbility: crash when trying to create ability ";
|
||||||
|
Sentry.getContext().recordBreadcrumb(
|
||||||
|
new BreadcrumbBuilder().setMessage(msg)
|
||||||
|
.withData("Card", state.getName()).withData("Ability", abString).build()
|
||||||
|
);
|
||||||
|
throw new RuntimeException(msg + " of card: " + state.getName(), ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final SpellAbility getAbility(final Card hostCard, final String svar) {
|
public static final SpellAbility getAbility(final Card hostCard, final String svar) {
|
||||||
|
|||||||
@@ -1447,6 +1447,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
for (KeywordInterface inst : keywords) {
|
for (KeywordInterface inst : keywords) {
|
||||||
String keyword = inst.getOriginal();
|
String keyword = inst.getOriginal();
|
||||||
|
try {
|
||||||
if (keyword.startsWith("SpellCantTarget")) {
|
if (keyword.startsWith("SpellCantTarget")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1691,6 +1692,15 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
|
} catch (Exception e) {
|
||||||
|
String msg = "Card:keywordToText: crash in Keyword parsing";
|
||||||
|
Sentry.getContext().recordBreadcrumb(
|
||||||
|
new BreadcrumbBuilder().setMessage(msg)
|
||||||
|
.withData("Card", this.getName()).withData("Keyword", keyword).build()
|
||||||
|
);
|
||||||
|
|
||||||
|
throw new RuntimeException("Error in Card " + this.getName() + " with Keyword " + keyword, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (sb.length() > 0) {
|
if (sb.length() > 0) {
|
||||||
sb.append("\r\n");
|
sb.append("\r\n");
|
||||||
|
|||||||
@@ -430,6 +430,9 @@ public class CardFactory {
|
|||||||
|
|
||||||
private static void readCardFace(Card c, ICardFace face) {
|
private static void readCardFace(Card c, ICardFace face) {
|
||||||
|
|
||||||
|
// Name first so Senty has the Card name
|
||||||
|
c.setName(face.getName());
|
||||||
|
|
||||||
for (String r : face.getReplacements()) c.addReplacementEffect(ReplacementHandler.parseReplacement(r, c, true));
|
for (String r : face.getReplacements()) c.addReplacementEffect(ReplacementHandler.parseReplacement(r, c, true));
|
||||||
for (String s : face.getStaticAbilities()) c.addStaticAbility(s);
|
for (String s : face.getStaticAbilities()) c.addStaticAbility(s);
|
||||||
for (String t : face.getTriggers()) c.addTrigger(TriggerHandler.parseTrigger(t, c, true));
|
for (String t : face.getTriggers()) c.addTrigger(TriggerHandler.parseTrigger(t, c, true));
|
||||||
@@ -439,7 +442,6 @@ public class CardFactory {
|
|||||||
// keywords not before variables
|
// keywords not before variables
|
||||||
c.addIntrinsicKeywords(face.getKeywords(), false);
|
c.addIntrinsicKeywords(face.getKeywords(), false);
|
||||||
|
|
||||||
c.setName(face.getName());
|
|
||||||
c.setManaCost(face.getManaCost());
|
c.setManaCost(face.getManaCost());
|
||||||
c.setText(face.getNonAbilityText());
|
c.setText(face.getNonAbilityText());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user