Sunday, 4 August 2019

Sending response data from the back-end is not caught in the front-end

Hello all,I have a login form and when I make a post request with invalid data, I send status 412, plus {errorMessage:"blabla"}.However, in the front-end where I do the request with axios, I get an error that if I print it I get: Error: "Request failed with status code 412" createError createError.js:17 settle settle.js:19handleLoad xhr.js:60If I transform it to JSON I do not see any data element. The strange thing is that if I go to the dev tools, network tabs and check the response received, I can clearly see the errorMessage:"blabla" is there. Why axios is not picking up this? Can anybody help me please?Thank you in advance.

Submitted August 04, 2019 at 01:15PM by dejavits

No comments:

Post a Comment