Open dospunk opened 3 years ago
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 🙏
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