Is the processing of the return value from an event handler on `xhr` part of the public API?

Is the processing of the return value from an event handler on `xhr` part of the public API?

lddldd Posts: 2Questions: 1Answers: 0

The code of DataTables contains a check on the return value of the xhr event handler but I don't see the return value being documented in the page that covers xhr. Is it meant to be part of the public API but was forgotten? Or should I not count on it?

Here is the part of the code I'm talking about.

var ret = _fnCallbackFire( oSettings, null, 'xhr', [oSettings, null, oSettings.jqXHR] );

if ( $.inArray( true, ret ) === -1 ) {
  if ( error == "parsererror" ) {
    _fnLog( oSettings, 0, 'Invalid JSON response', 1 );
  }
  else if ( xhr.readyState === 4 ) {
    _fnLog( oSettings, 0, 'Ajax error', 7 );
  }
}   

This question has an accepted answers - jump to answer

Answers

  • Tom (DataTables)Tom (DataTables) Posts: 139Questions: 0Answers: 26

    Thanks for pointing this out, we'll look into it and post back shortly.

    Thanks

    Tom

  • lddldd Posts: 2Questions: 1Answers: 0

    Thank you.

    For what it's worth, I think this would be useful as part of the public API. I have a customization I want to do where my code would handle errors and thus it would be useful to turn off DataTables' default error reporting.

  • allanallan Posts: 63,799Questions: 1Answers: 10,514 Site admin
    edited June 2016 Answer ✓

    It turns out that it is actually in the documentation source file but my build script for the site was looking for returns rather than return. I've got it doing both now and its in the xhr documentation now.

    Thanks for letting us know about this!

    Allan

This discussion has been closed.