Im trying to catch validation errors from the server.
Code:
axios.post('https://myBackendIp.com/api/teacher/time/create',Data)
.then(res=>{
console.log(res)
}).catch(error=>{
console.log(error)
})
Console log output
Error: Network Error
at createError (createError.js:16)
at handleError (xhr.js:87)
Network tab output
{"error":{"message":"Check your date field","status_code":500}}
Is there a way to change that or I'm doing something wrong?
Thanks!