Catch JSON error returned by editor datatables

Catch JSON error returned by editor datatables

daanbonkedaanbonke Posts: 7Questions: 5Answers: 0

Hello,

I'm trying to catch an error returned by editor datatables.
To be more precise this JSON string:

{"error":"SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2014-1-138-7' for key 'financieel_unique_index'"}

Can I somehow catch that error and display an alert box to the user?

Thanks in advance.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Answer ✓

    Hi,

    You can't catch the error as such, but you can listen for it using the postSubmit event and checking the JSON data for the error property.

    Allan

This discussion has been closed.