Quite simply, I want my javascript to be able to react to a fatal 500 error caused by PHP, appropriately to the error.
My goal is simply to collect the fatal error message that the script produced, so I can show it on the client side.
Is this in any way possible?
EDIT: cleaned up the question, in case it gets, by chance, it gets searched.
Processing Fatal Errors in PHP:
By checking for all fatal errors, you won’t trigger the handle for notices or warnings that happened earlier, but didn’t stop execution of the script. Hopefully you already handle those.
Side note:
Handling fatal errors using jQuery:
See http://api.jquery.com/ajaxError/ for more details.
Final Note: display errors should be off if you wish to parse JSON, or text will appear before the JSON encoded object.