Update Sentry libs

- fix Java Property on startup
This commit is contained in:
Anthony Calosa
2024-08-13 20:11:20 +08:00
parent 3541fe1157
commit 4a2991588b
10 changed files with 48 additions and 24 deletions

View File

@@ -6,6 +6,7 @@ import java.util.List;
import java.util.Map;
import forge.util.Lang;
import io.sentry.Hint;
import org.apache.commons.lang3.StringUtils;
import forge.card.ColorSet;
@@ -240,7 +241,9 @@ public class ManaEffect extends SpellAbilityEffect {
Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Card", card.getName());
bread.setData("SA", sa.toString());
Sentry.addBreadcrumb(bread, sa);
Hint hint = new Hint();
hint.set(sa.toString(), sa);
Sentry.addBreadcrumb(bread, hint);
continue;
}

View File

@@ -56,6 +56,7 @@ import forge.util.*;
import forge.util.collect.FCollection;
import forge.util.collect.FCollectionView;
import io.sentry.Breadcrumb;
import io.sentry.Hint;
import io.sentry.Sentry;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.mutable.MutableBoolean;
@@ -2613,7 +2614,9 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Card", this.getName());
bread.setData("Keyword", keyword);
Sentry.addBreadcrumb(bread, this);
Hint hint = new Hint();
hint.set(this.getName(), this);
Sentry.addBreadcrumb(bread, hint);
throw new RuntimeException("Error in Card " + this.getName() + " with Keyword " + keyword, e);
}
@@ -3184,7 +3187,9 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Card", this.getName());
bread.setData("Keyword", keyword);
Sentry.addBreadcrumb(bread, this);
Hint hint = new Hint();
hint.set(this.getName(), this);
Sentry.addBreadcrumb(bread, hint);
throw new RuntimeException("Error in Card " + this.getName() + " with Keyword " + keyword, e);
}

View File

@@ -10,6 +10,7 @@ import forge.game.ability.ApiType;
import forge.game.player.Player;
import forge.game.spellability.SpellAbility;
import io.sentry.Breadcrumb;
import io.sentry.Hint;
import io.sentry.Sentry;
import java.util.List;
@@ -214,7 +215,9 @@ public class CardCopyService {
bread.setData("Card", copyFrom.getName());
bread.setData("CardState", copyFrom.getCurrentStateName().toString());
bread.setData("Player", copyFrom.getController().getName());
Sentry.addBreadcrumb(bread, copyFrom);
Hint hint = new Hint();
hint.set(copyFrom.getName(), copyFrom);
Sentry.addBreadcrumb(bread, hint);
final Card newCopy = new Card(copyFrom.getId(), copyFrom.getPaperCard(), copyFrom.getGame(), null);
cachedMap.put(copyFrom.getId(), newCopy);

View File

@@ -51,6 +51,7 @@ import forge.util.Localizer;
import forge.util.TextUtil;
import io.sentry.Breadcrumb;
import io.sentry.Sentry;
import io.sentry.Hint;
import org.apache.commons.lang3.StringUtils;
import java.util.*;
@@ -542,7 +543,9 @@ public class CardFactoryUtil {
Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Card", card.getName());
bread.setData("Ability", rawAbility);
Sentry.addBreadcrumb(bread, card);
Hint hint = new Hint();
hint.set(card.getName(), card);
Sentry.addBreadcrumb(bread, hint);
// rethrow the exception with card Name for the user
throw new RuntimeException("crash in raw Ability, check card script of " + card.getName(), e);

View File

@@ -50,6 +50,7 @@ import forge.game.trigger.Trigger;
import forge.util.collect.FCollection;
import forge.util.collect.FCollectionView;
import io.sentry.Breadcrumb;
import io.sentry.Hint;
import io.sentry.Sentry;
public class CardState extends GameObject implements IHasSVars {
@@ -303,7 +304,9 @@ public class CardState extends GameObject implements IHasSVars {
Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Card", card.getName());
bread.setData("Keyword", s);
Sentry.addBreadcrumb(bread, this);
Hint hint = new Hint();
hint.set(this.name, this);
Sentry.addBreadcrumb(bread, hint);
//rethrow
throw new RuntimeException("Error in Keyword " + s + " for card " + card.getName(), e);

View File

@@ -17,6 +17,7 @@ import forge.game.staticability.StaticAbility;
import forge.game.trigger.Trigger;
import forge.util.Lang;
import io.sentry.Breadcrumb;
import io.sentry.Hint;
import io.sentry.Sentry;
public abstract class KeywordInstance<T extends KeywordInstance<?>> implements KeywordInterface {
@@ -106,7 +107,9 @@ public abstract class KeywordInstance<T extends KeywordInstance<?>> implements K
Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Card", host.getName());
bread.setData("Keyword", this.original);
Sentry.addBreadcrumb(bread, this);
Hint hint = new Hint();
hint.set(this.original, this);
Sentry.addBreadcrumb(bread, hint);
// add Extra for debugging
Sentry.setExtra("Card", host.getName());
@@ -122,7 +125,9 @@ public abstract class KeywordInstance<T extends KeywordInstance<?>> implements K
Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Card", host.getName());
bread.setData("Keyword", this.original);
Sentry.addBreadcrumb(bread, this);
Hint hint = new Hint();
hint.set(this.original, this);
Sentry.addBreadcrumb(bread, hint);
//rethrow
throw new RuntimeException("Error in Keyword " + this.original + " for card " + host.getName(), e);
@@ -157,7 +162,9 @@ public abstract class KeywordInstance<T extends KeywordInstance<?>> implements K
Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Player", player.getName());
bread.setData("Keyword", this.original);
Sentry.addBreadcrumb(bread, this);
Hint hint = new Hint();
hint.set(this.original, this);
Sentry.addBreadcrumb(bread, hint);
// add Extra for debugging
Sentry.setExtra("Player", player.getName());
@@ -173,7 +180,9 @@ public abstract class KeywordInstance<T extends KeywordInstance<?>> implements K
Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Player", player.getName());
bread.setData("Keyword", this.original);
Sentry.addBreadcrumb(bread, this);
Hint hint = new Hint();
hint.set(this.original, this);
Sentry.addBreadcrumb(bread, hint);
//rethrow
throw new RuntimeException("Error in Keyword " + this.original + " for player " + player.getName(), e);

View File

@@ -43,6 +43,7 @@ import forge.game.zone.ZoneType;
import forge.util.FileSection;
import forge.util.Visitor;
import io.sentry.Breadcrumb;
import io.sentry.Hint;
import io.sentry.Sentry;
public class TriggerHandler {
@@ -135,7 +136,9 @@ public class TriggerHandler {
Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Card", host.getName());
bread.setData("Trigger", trigParse);
Sentry.addBreadcrumb(bread, host);
Hint hint = new Hint();
hint.set(host.getName(), host);
Sentry.addBreadcrumb(bread, hint);
//rethrow
throw new RuntimeException("Error in Trigger for Card: " + host.getName(), e);
@@ -163,7 +166,9 @@ public class TriggerHandler {
Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Card", host.getName());
bread.setData("Params", mapParams.toString());
Sentry.addBreadcrumb(bread, host);
Hint hint = new Hint();
hint.set(host.getName(), host);
Sentry.addBreadcrumb(bread, hint);
//rethrow
throw new RuntimeException("Error in Trigger for Card: " + host.getName(), e);