Shared across modules ยท console.warn
{module}: a '{event}' before-handler rejected; the action was cancelled.
Printed by Shared across modules, prefixed [lattice], since 1.53.0.
Warnings reference › *.beforeReject:*
- Identifier
*.beforeReject:*- Raised by
- Shared across modules
- Since
- 1.53.0
What happened
An asynchronous before-handler returned a promise and that promise rejected. The module waits for every deferred handler - a logging handler still runs alongside a vetoing one - and treats a rejection the same way it treats a throw: the action is cancelled and the reason is reported.
The fix
The rejection reason is attached to the console line. Resolve false to veto deliberately; resolve anything else to allow the action.
The smallest fix
gantt.on('beforeTaskEdit', async (e) => (await mayEdit(e.task)) !== false);
Reference
Covered in full at the API reference.