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

Dialog Plugin - callback errors not handled globally #17871

Open
deyanix opened this issue Feb 28, 2025 · 0 comments
Open

Dialog Plugin - callback errors not handled globally #17871

deyanix opened this issue Feb 28, 2025 · 0 comments
Labels
area/plugins bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues

Comments

@deyanix
Copy link

deyanix commented Feb 28, 2025

What happened?

Errors thrown in async callbacks (onOk, onCancel or onDismiss) don't trigger Vue’s global errorHandler. Additionally, errors thrown in synchronous callbacks (onOk or onCancel) prevent onDismiss from being called, but at least these errors are handled by the global errorHandler.

What did you expect to happen?

I expected errors from the Dialog plugin callbacks to be caught by the global errorHandler. Currently, I have to wrap the callbacks in a try-catch block with a global error-handling mechanism. While it might be reasonable for errors from synchronous callbacks to abort onDismiss, async callbacks, in my opinion, should be handled globally. Ideally, regardless of whether they are synchronous or asynchronous, all callbacks should run independently of each other, and their errors should be handled globally.

Reproduction URL

https://jsfiddle.net/23h7pao8/

How to reproduce?

  1. Open the example fiddle.
  2. Click the "Error" button.
    • The error will be caught by the global errorHandler.
  3. Click the "Dialog" button, then click "Ok" or "Cancel".
    • This demonstrates the behavior of synchronous callbacks. A notification appears before the error is thrown and handled globally. However, the notification from onDismiss is not triggered.
  4. Click the "Dialog async" button, then click "Ok" or "Cancel".
    • This demonstrates the behavior of asynchronous callbacks. Two notifications appear before the error is thrown - one from onOk/onCancel and another from onDismiss. However, the errors are never handled globally.

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Plugins (quasar)

Platforms/Browsers

No response

Quasar info output

Relevant log output

Additional context

No response

@deyanix deyanix added kind/bug 🐞 Qv2 🔝 Quasar v2 issues labels Feb 28, 2025
@github-actions github-actions bot added area/plugins bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite labels Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/plugins bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues
Projects
None yet
Development

No branches or pull requests

1 participant