Custom error not showing since 1.10.9
Custom error not showing since 1.10.9

I created a simple fiddle to demonstrate the issue https://jsfiddle.net/320t98L6/1
Basically the 'on error' event does not seem to trigger in the latest version 1.10.22 (jquery 3.4.1)
If you use version 1.10.9 or lower, it works as intended. Any help is greatly appreciated
Sample code below:
$.fn.dataTable.ext.errMode = 'none';
$('#example').on('error.dt', function(e, settings, techNote, message) {
alert( 'An error has been reported by DataTables: ', message );
})
$("#example").DataTable();
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Answers
I tried it here with 1.10.8, and it does the same as yours, so I'm not seeing a behavioural change. We'll take a look and report back,
Colin
https://jsfiddle.net/CloudTables/Lae9gv02/1/
error
is still triggering, but it only triggers for errors that DataTables "knows" about - i.e. the Ajax response being invalid JSON. We specifically trigger error messages for some error states.The case where the columns in the header and the body don't match in length, appears to be an error that DataTables is no longer throwing its own message about. Rather there is a generic JS error being thrown.
I'll have a look and see how we can improve our error messages for this state.
Allan
Thanks for the reply but actually on my case, I just needed it to alert some message returned from the server side, something like below:
This use to work before, but it stopped, somewhere along the way when I upgraded to 1.10.16 or jquery 3.4.1
My code is a bit of a mess now, in the middle of upgrading, so cant really pin point yet where the actual issue is, but I'll keep both of you posted if I found anything.