[Fix] Trigger Error Info (#2030)

* Made trigger errors more informative

* .
This commit is contained in:
WBHarry 2026-06-21 23:35:38 +02:00 committed by GitHub
parent f385982987
commit 0d59e37a80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View file

@ -1451,7 +1451,7 @@
},
"triggerType": "Trigger Type",
"triggeringActorType": "Triggering Actor Type",
"triggerError": "{trigger} trigger failed for {actor}. It's probably configured wrong."
"triggerError": "{trigger} trigger on {item}({itemUuid}) failed for {actor}. It's probably configured wrong."
},
"WeaponFeature": {
"barrier": {

View file

@ -150,11 +150,14 @@ export default class RegisteredTriggers extends Map {
const result = await command(...args);
if (result?.updates?.length) updates.push(...result.updates);
} catch {
const item = await foundry.utils.fromUuid(itemUuid);
const triggerName = game.i18n.localize(triggerData.label);
ui.notifications.error(
console.error(
game.i18n.format('DAGGERHEART.CONFIG.Triggers.triggerError', {
trigger: triggerName,
actor: currentActor?.name
actor: currentActor?.name,
item: item?.name ?? '<Missing Item>',
itemUuid: item?.uuid ?? '<Missing UUID>'
})
);
}