I just wanted to keep an "Ajax Log" on my application. What do I mean? Having a way to store all the "Internal Server Error" of AJAX requests.
Plus, having to change all the $.ajax
calls would not be useful (if I change the storage system or the error type etc... I shall change all occurences).
So that's what I've got for now :
I made a global AJAX Event function simply with that instruction : $(document).ajaxError(sendErrorAjax);
And that's what my sendErrorAjax
function might look like :
function sendErrorAjax( event, response, settings )
{
let message = 'Error on URL [' + settings.url + '] - Error ' + response.status + ' : ' + response.statusText;
addToLogs(message);
}
And that works fine! But I'd like to have more precise informations : What about retreiving the data that was sent (client side, not the server side)?
Is there any way to get them?