I\'m using JQuery to call a PHP function that returns a JSON string upon success or throws some exceptions. Currently I\'m calling jQuery.parseJSON() on the res
jQuery.parseJSON()
Catch the exception on the PHP end, and output an error message in JSON format:
echo json_encode(array( 'error' => $e->getMessage(), ));