Promise should return full error object
See original GitHub issueHi,
Currently this package return error.response
when promise fails
https://github.com/spatie/form-backend-validation/blob/master/src/Form.js#L173
But i want to leverage axios error object, see how https://github.com/mzabriskie/axios#handling-errors
We should return full error object so the developer can fully utilize it.
.catch((error) => {
this.processing = false;
this.onFail(error.response.data);
// return error not just response
reject(error);
});
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Error handling with promises
In the task an error is thrown form inside the promise and promise is never settled neither with a resolve nor reject. The...
Read more >Promise.prototype.catch() - JavaScript - MDN Web Docs
The catch method is used for error handling in promise composition. Since it returns a Promise , it can be chained in the...
Read more >Promise Error Handling
In this tutorial, you will learn about promise error handling that shows you how to handle error in promises.
Read more >javascript - How do I handle errors with promises?
myFn(param).then(function(calcN){ // here, you throw to raise an error and return to resolve // new Promise should be used only when ...
Read more >JavaScript Promises – The promise.then, promise.catch ...
then : when a promise is successful, you can then use the resolved data · catch : when a promise fails, you catch...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If there is a network timeout, that error object won’t have a response property, and it’s going to crash any return with a type error. I’m running into this now.
The minute Laravel 5.5 is officially released, so some time next week 😃