Show error

Show error

Andreas S.Andreas S. Posts: 207Questions: 73Answers: 4

During the init of the Datatable, my server process send to the client an error in a json format.
How can i put this information in a modal windows? Datatables give me an error, that are missing data
to build the table but i need the Information of the Server

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,438Questions: 1Answers: 10,052 Site admin
  • Andreas S.Andreas S. Posts: 207Questions: 73Answers: 4

    Is there a defined json format, that the error from the server are shown? I implement this code:

            $.fn.dataTable.ext.errMode = 'throw';
    
            $('#event_structure').on( 'error.dt', function( e, settings, techNote, message ) {
                console.log( message );
            } );
    

    But I did not see the Server error in my console.log

    Andreas

  • Andreas S.Andreas S. Posts: 207Questions: 73Answers: 4

    I ask this question in January, but I did not work to put the error in a tost notification. The Reference to throw an error and the example did not work. How should send the server an error to the client? Is there a specific json format?

    Andreas

  • colincolin Posts: 15,112Questions: 1Answers: 2,583
    Answer ✓

    Hi @Andreas S. ,

    Does this thread here help? Allan's final comment seems to answer what you're looking for.

    Cheers,

    Colin

  • Andreas S.Andreas S. Posts: 207Questions: 73Answers: 4

    yes that that help me.

    Thanks Colin

This discussion has been closed.