I am attempting to catch and display an exception in my front-end, React, that is being thrown by the back-end (spring).
When I debug with Postman, I get the exception in JSON format just like I want-
However, in React I am only receiving the status code
I am stumped by this seemingly simple problem.
Board.js
DataService.makeMove(move)
.then(res => {
//console.log(res.data);
setIsWhite((prev) => !prev);
props.setTheBoard(res.data);
setStatus(res.data[64]);
updateMovesList();
})
.catch(err => {
console.log(err)
//I added a bunch of nonsense console logs to try to find the info but they were mostly undefined as expected
console.log(err.errMessage)
console.log(err.message)
console.log(err.status)
console.log(err.errReason)
})
DataService.js
makeMove(move){
return axios.post(`${url}`, move);
}

