Custom Error Message after Datatables ajax exception
<p>I am displaying a table of data using datatables 1.10.12.  The user can specify input parameters that cause an error on the server.  An appropriate error message should be displayed to the user so they can modify their setup, however the only error options seem to be:</p>

<ol>
<li>SHow the following generic error in an alert: "DataTables warning: table id=trackingTable - Ajax error. For more information about this error, please see <a href="http://datatables.net/tn/7" rel="noreferrer">http://datatables.net/tn/7</a>"</li>
<li>Show the generic error in the browser console</li>
<li>Modify the server to return no rows, that is fail silently.</li>
</ol>

<p>Does anyone know how to show a custom error after a datatables ajax request fails?</p>

<p>The following code sample is taken from the datatables <a href="https://datatables.net/examples/ajax/simple.html" rel="noreferrer">documentation</a>.  Datatables handles the ajax call and handles success and error.  </p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
    $('#example').DataTable( {
        "ajax": '../ajax/data/arrays.txt'
    } );
} );</code></pre>
</div>
</div>
</p>

<p>A 4th option I could add to the list would be to modify the datatables source code to handle the an error response myself. Which I'm not that keen on.</p>

<p>This question was asked in 2015 however it did not get an answer. See:
<a href="https://stackoverflow.com/questions/33940524/display-server-side-exception-message-on-datatables-net">display server side exception</a></p>