mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
804ad3c35e
Previously, a crash in a lifecycle hook for any reason would throw an error whose stack trace started from the scheduler and contained only the place where the hook was called by owl, but not the place where the hook was registered by the user. This proved very difficult for users to debug as they cannot really tell which component registered that hook. This commit alleviates the issue by creating a new Error when the hook is originally called, and wrapping the registered callback in a try catch, throwing an error with the correct stack trace instead of the error in the hook, and setting the error in the hook as the cause of this synthetic error.