How to handle errors in server side datatables?
How to handle errors in server side datatables?

if errors are occure or page not found, i want to throw an error, i tried some ways but they did'nt give me the solution.
ajax: {
data: function (data) {
data.token = localStorage.getItem("token"),
},
'url': 'api/v1/bookings',
//error: function (xhr, error, code)
// {
// console.log(xhr);
// console.log(code);
// }
//this also not working
dataFilter: function (data) {
self.closeFullPageLoader();
var json = jQuery.parseJSON(data);
var response = json.data.searchResults;
self.bookings = response.bookings;
json.data = response.bookings;
json.recordsFiltered = response.recordsFiltered;
json.recordsTotal = response.recordsTotal;
return JSON.stringify(json);
}
},
$('#booking_list')
.on( 'error.dt', function ( e, settings, techNote, message ) {
console.log( 'An error has been reported by DataTables: ', message );
} )
This discussion has been closed.
Answers
Hi @madusanka ,
These threads, here and here, should help, it's asking the same thing.
Cheers,
Colin
Thanks @colin
i got the solution