Best practice to handle server side errors

Best practice to handle server side errors

vinodjayendravinodjayendra Posts: 5Questions: 0Answers: 0
edited March 2013 in Bug reports
Hi,

I am looking for some good practices to follow for handling server side errors on the datatable. We have a list of server side exceptions to be caught and appropriately display a custom error message on the datatable.

Some approaches i was thinking about was
1) Return different response.status codes for each exception in json response, interpret them in datatable and display appropriate error message
2) Generate a custom error message on server side itself based on exception, return it as part of json response and display them on the datatable.

Wanted to check how best others have dealt with this before ...

Replies

  • allanallan Posts: 57,244Questions: 1Answers: 9,113 Site admin
    not sure there is a best practice for this - it just comes down to how you want to display he errors to your users and transmit the data around. Either way - have this ability is certainly a good idea!

    Allan
  • vinodjayendravinodjayendra Posts: 5Questions: 0Answers: 0
    Thanks Allan for the response.

    Moving to implementation.
    1) For processing the error message on datatable is the only way to override the fnServerData with appropriate error function ?

    2) I do not want to alert the error but display the error message neatly as part of the table, checking if any sample code snippets available for this showing appropriate i being tweaked
This discussion has been closed.