Regularly getting problems with errors in datatables...

Regularly getting problems with errors in datatables...

timdigginstimdiggins Posts: 9Questions: 2Answers: 0

I'm regularly getting problems within my exception handling system (Bugsnag). Bugsnag complains that "window onerror received a non-error" - as in the window.onerror was passed (by datatables, somehow) the wrong arguments.

This was pointed out in an earlier datatables discussion (https://datatables.net/forums/discussion/59184/wrong-arguments-to-window-onerror-when-using-datatables-1-10-19-and-1-10-20), but I think had the wrong resolution -- I understand the resolution to be "could not reproduce". But I think the reason the alert is being shown rather than the onerror handler is because the onerror handler is being given incorrect arguments (though I'm not sure). But it is somehow in datatables that the failure to call onerror correctly is happening? (wherelse could it be?). I can try and work up another minimal repro, but the previous one seems to demonstrate the problem (I believe!).

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    Answer ✓

    So, I think the issue here is that DataTables will trigger an event named error. If there is an onError global handler that gets triggered by that call, which is what you are seeing.

    I've already committed a change to DataTables 2 to rename the event to dt-error for exactly this reason. If you search the code for var type = ext.sErrMode a couple of lines later you'll see the call to the callback trigger which passes the event name. If you have a copy of the code locally you could change it to dt-error. I don't want to put that into 1.x though as it is an API change, even although a buggy API...

    Allan

  • timdigginstimdiggins Posts: 9Questions: 2Answers: 0

    Ah - ok, thanks - is there a release plan/timeline/beta for DataTables 2 (and also what other planned api changes there are -- will it be in general straightforward to upgrade?)

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    I'm hoping it will be before the end of the year. DataTables 2 is basically code complete. I'm working my way through the extensions to update them to my latest standards and APIs for DataTables / docs / examples / etc. That is taking a while as there are so many of them!

    Yes, it should be a simple replacement upgrade unless you are using the legacy API (fnDraw() etc) or any internal APIs.

    Allan

Sign In or Register to comment.