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.

Errors added after axios request 'auto-clearing'.

See original GitHub issue

Versions:

  • VueJs: 2.5.7
  • Vee-Validate: 2.1.0-beta.7

Hey everyone!

Im trying to set laravel errors from an axios request to my v validate error bag, apparently the error it’s added correctly but it’s auto cleared immediately.

My code its on a compiled webpack file, for debugging I tried to move this to html script tag and add the error manually from console, this seems to work, so don’t really know what’s happening with that auto clearing after the axios request.

What I’m missing? I have a little gif with the “auto-clearing” (email field) where you can see how it’s set for a moment and then gone

errobagg

And this is the chunk of code from the axios request, it’s a very simple request so I don’t really have a clue of what is happening.

.catch(error => {
     let requestErrors = error.response.data;
     let errorFields = Object.keys(requestErrors.errors);
     errorFields.map(field => {
          let errorString = requestErrors.errors[field].join(', ');
          this.errors.add({field: field, msg: errorString});
     });
});

Finally, amazing work, keep it good ❤️

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
logaretmcommented, Aug 11, 2018

I will need to take a look at your template, can you replicate a version at codesandbox with a mocked API?

Does the latest stable 2.0.9 produce the expected result? or is it broken since then?

0reactions
logaretmcommented, Aug 23, 2018

Glad to hear, we can close this for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Axios handling errors - Stack Overflow
To do that you can create a new promise resolve it when axios request is successful and never reject it in case of...
Read more >
Handling Errors | Axios Docs
request ) { // The request was made but no response was received // `error.request` is an instance of XMLHttpRequest in the browser...
Read more >
How to handle errors with Axios request - Educative.io
Overview. We can add the catch function to the axios request to handle the error response for the sent request. The catch function...
Read more >
How to handle API errors in your web app using axios
Whenever you're making a backend API call with axios, you have to ... Errors" and that dropped down to <2% after adding in...
Read more >
DayZ Update 1 19 155390 Patch Notes The Nerd Stash
DayZ 1 19 155390 Update Patch Notes DayZ 1.19.155390 Update Game Added M1025 ... launcher Cooking sounds would persist on the spot even...
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