get json data when we get error code in axios

JavaScript
if(params.has_key?(:one) && params.has_key?(:two))// Send the variables myNumber=1 and myFruit="orange" to the new PHP page...
<a href="page2.php?myNumber=1&myFruit=orange">Next page</a> 
axios.post('/formulas/create', {
	name: "",
	parts: ""
})
.then(response => { 
	console.log(response)
})
.catch(error => {
    console.log(error.response)
});

Source

Also in JavaScript: