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

[Feature Request] Option to not catch errors #50

Open
dospunk opened this issue Jul 21, 2021 · 1 comment
Open

[Feature Request] Option to not catch errors #50

dospunk opened this issue Jul 21, 2021 · 1 comment

Comments

@dospunk
Copy link

dospunk commented Jul 21, 2021

For projects with a global error handler the current system introduces boilerplate that would not be necessary if there were an option to not catch errors at all

@MartinMalinda
Copy link
Owner

MartinMalinda commented Feb 18, 2022

The task definitely has to break execution on error. But it could definitely always pass the error upfront (rethrow). I was also thinking about some global hook for errors for the entire vue-concurrency. There you could also just rethrow yourself or do whatever else (console.error, report error etc).

But so far the usage of tasks is like this:

import { useTask } from 'vue-concurrency';

I'm not sure if it's possible to do something like this:

import { configureTasks } from 'vue-concurrency';

configureTasks({
  onError: (error) => {
    // your global on error handling goes here
   }
}); 

This setting would have to persist somehow. Maybe if it was assigned to to some variable in the module context it would be fine... I'll try 🙏

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

No branches or pull requests

2 participants