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

Call errorCaptured on Promise rejection #70

Open
johannes-z opened this issue Mar 5, 2019 · 2 comments
Open

Call errorCaptured on Promise rejection #70

johannes-z opened this issue Mar 5, 2019 · 2 comments

Comments

@johannes-z
Copy link
Contributor

johannes-z commented Mar 5, 2019

When throwing an Error inside the get () method of the asyncComputed, the component's registered errorCaptured handler is not being called. Can/Should this be added?

  errorCaptured: (err, vm, info) => {
    console.log(arguments)
  },
  asyncComputed: {
    posts: {
      lazy: true,
      default: () => [],
      async get () {
        throw new Error('error')
      }
    }
  }
@foxbenjaminfox
Copy link
Owner

Yes, I see. vue-async-computed predates the errorCaptured error handling mechanism in Vue, so that's why it has it's own different error handling. But now that Vue has this robust error handling mechanism, it makes sense to use it, at least as a fallback after vue-async-computed's error handling. (And then in the next major version of vue-async-computed, I suppose I'd remove vue-async-computed's own custom error handling completely.)

@ladjzero
Copy link

ladjzero commented Feb 9, 2021

Yes. Rejection error can escape the error boundary which catches error via errorCaptured.

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

3 participants