How to catch a rejected promise state from @MutationAction? Hope someone can help me.😦
Ran into the same thing with MutationActions, doesn't seem to be a problem if you use a mutation action pair, so it kinda defeats the point of the MutationAction if you rely on promises. I'll see if I can get a PR put together that throws the error back up.
Also figured out if raw error is set like:
@MutationAction({rawError: true})
then the promise will get rejected.
Also figured out if raw error is set like:
@MutationAction({rawError: true})
then the promise will get rejected.
Thanks, Bro. I solved this by using rawError: true. By the way, I wish this can be added in the docs.
☝️ +1 for this issue and ping @championswimmer .
As a Vue AND TS beginner I spent way too long trying to figure out what was the issue and where were my errors going. I would go as far as saying that the errors get obfuscated in the lib and Vue components never see the errors and thus error handling gets very difficult.
I already +1'd the above comments regarding the rawError flag but I didn't seem to be able to figure out how to get that to work the way I wanted to.
The pull request seems to fix the issue however and it's already approved so I would like to see it included ASAP.
For now I think I'll have to revert to mutation action pairs even though I really liked the simplicity of MutationActions!
PS. this error is easily reproducable with the https://github.com/coding-blocks-archives/realworld-vue-typescript demo app / tutorial whenever you try to login with invalid username / password. As the error never reaches the Vue component the error message is never shown and instead the page routes to home page as if logging in was successful
Thanks, will add this to docs
On Wed, 21 Aug, 2019, 3:07 PM Eetu Mansikkamäki, notifications@github.com
wrote:
☝️ +1 for this issue and ping @championswimmer
https://github.com/championswimmer .As a Vue AND TS beginner I spent way too long trying to figure out what
was the issue and where were my errors going. I would go as far as saying
that the errors get obfuscated in the lib and Vue components never see the
errors and thus error handling gets very difficult.I already +1'd the above comments regarding the rawError flag but I didn't
seem to be able to figure out how to get that to work the way I wanted to.The pull request seems to fix the issue however and it's already approved
so I would like to see it included ASAP.For now I think I'll have to revert to mutation action pairs even though I
really liked the simplicity of MutationActions!PS. this error is easily reproducable with the
https://github.com/coding-blocks-archives/realworld-vue-typescript demo
app / tutorial whenever you try to login with invalid username / password.
As the error never reaches the Vue component the error message is never
shown and instead the page routes to home page as if logging in was
successful—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/championswimmer/vuex-module-decorators/issues/122?email_source=notifications&email_token=AAKD7SRQPT57XZX4ORL67ZTQFUEGJA5CNFSM4HMXVFY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4ZCNNY#issuecomment-523380407,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAKD7SWTMZLMY64ODZ7XBX3QFUEGJANCNFSM4HMXVFYQ
.
@championswimmer still not in the docs by the way and the default behavior with this set to true is quite puzzling :-/
Just had an issue with this for a few hours as well - the behavior is somewhat strange.
Most helpful comment
Thanks, Bro. I solved this by using
rawError: true. By the way, I wish this can be added in the docs.