Catch JSON error returned by editor datatables
Catch JSON error returned by editor datatables
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
This discussion has been closed.
Answers
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 theerror
property.Allan