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

[Bug]: Failing assertions in event macros are treated as unexpected errors #4391

Open
kwvanderlinde opened this issue Nov 11, 2023 · 0 comments
Assignees
Labels

Comments

@kwvanderlinde
Copy link
Collaborator

Describe the Bug

When an assertion fails in an event macro (onTokenMove, onCampaignLoad, etc.), there is an error message printed to chat rather than the normal assert messaging.

To Reproduce

  1. Add this to a lib:token's onCampaignLoad:
    [h: assert(0, "This is a message", 0)]
    
  2. Save and reload the campaign.
  3. Observe this error in chat:

    Event continuing after error running onCampaignLoad@Lib:Elf: This is a message

Expected Behaviour

The assertion failure should be printed plainly without being treated as an unexpected failure in the event handler. I.e., this is all that should be sent to chat:

This is a message

Or if the prefix is enabled:

Macro-defined error: This is a message

Screenshots

No response

MapTool Info

1.13.2

Desktop

Linux Mint 21.2

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Needs Testing
Development

No branches or pull requests

1 participant