question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support error messages from validation promise

See original GitHub issue

Hello,

I am validating values remotely using VueResource and returning a Promise, which works well. The only thing I am missing is the support to display the error messages sent back by the server.

I used the vue-validator package before, which allowed me to do something like that:

return ValidationResource.validate(params, body)
    .then((result) => {
        return Promise.resolve()
    }).catch(({ data }) => {
        return Promise.reject(data[field][0])
    })

I would love to have this functionality supported by vee-validator as well.

Regards, Andreas

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
logaretmcommented, Oct 30, 2016

Yep, I agree that the error messages are not flexible enough atm, I’m exploring different approaches to this.

0reactions
davidmmxxcommented, Feb 28, 2020

Just to clarify my error - function returned message from backend, but that was number 😃 and that was the problem. Promise from getLangtext() resolved number and that’s why it was not displayed in errors …

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom Error Messages - express-validator
Custom Error Messages ... express-validator's default error message is a simple Invalid value . That's enough to cover all fields without being too...
Read more >
How to set dynamic error messages in Yup async validation?
I am trying async validation in Formik using Yup's .test() method and need to set the error message that I get from the...
Read more >
Better error handling in JavaScript | by Iain Collins - Medium
It's best to avoid throwing errors from inside a Promise, because they may not always be caught, depending on how the code that...
Read more >
NG01003: Async validator must return a Promise or Observable
Async validators must return a promise or an observable, and emit/resolve them whether the validation fails or succeeds. In particular, they must implement ......
Read more >
PROMISe - PA Department of Human Services
Remittance Advice Alerts/PROMISe Banner Pages · Place of Service Crosswalk ... Error Status Codes appear on Remittance Advices and are returned on ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found