Using Laravel -
abort(403, 'This is an exception message.');
How can I access this message from my JavaScript?
// Get the project based on projectID.
$.ajax({
type: 'GET',
url: '/api/projects/getProject/' + projectID
}).done(function(response){
ProjectStore.getProjectSuccessful(response);
}).error(function(error){
console.log(error)
});
My error
object has a statusText
property of 'Forbidden', and a responseText
property that contains the entire HTML (in which I can see my error message) - but is there an easy way to access that message from my error object without parsing through the HTML?