Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors do not fail gracefull. #69

Open
rg-wood opened this issue Oct 30, 2021 · 0 comments
Open

Errors do not fail gracefull. #69

rg-wood opened this issue Oct 30, 2021 · 0 comments

Comments

@rg-wood
Copy link
Member

rg-wood commented Oct 30, 2021

Actual behaviour: Errors in the component are fatal, and can cause the entire stat block to not appear.

For example, if the multiattack action points to a non-existent attack ID:

actions='[
          {
            "name": "Multiattack",
            "type": "multiattack",
            "description": "The princess makes two command attacks.",
            "multiAttacks": {
              "id": "claw",
              "number": 2
            }
          },
          {
            "name": "Command",
            "id": "command",
            "type": "ranged-or-melee-attack",
            "bonus": "+5",
            "reach": "5ft.",
            "range": "60ft.",
            "target": "one target",
            "damage": "1d8 + 5",
            "damageType": "slashing"
          }
        ]'

...it fails with the following error:

Uncaught (in promise) TypeError: attack is undefined
    _calculateMultiattack vellum-monster.js:380
    get maxAttackBonus vellum-monster.js:352
    get effectiveAttackBonus vellum-monster.js:317
    get calculatedCrs vellum-monster.js:312
    renderStats vellum-monster.js:127
    render vellum-stat-block.ts:114
    update lit-element.ts:300
    performUpdate updating-element.ts:775
    _enqueueUpdate updating-element.ts:725
    requestUpdateInternal updating-element.ts:690
    initialize updating-element.ts:531
    initialize lit-element.ts:224
    UpdatingElement updating-element.ts:516
    LitElement lit-element.ts:101
    StatBlock vellum-stat-block.ts:5
    Monster vellum-monster.js:13
    <anonymous> vellum-monster.js:405
vellum-monster.js:380:8

Expected behaviour: <vellum-monster> should recover and display as much information as is readable. Errors should be reported to the console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant