Apologies for the subpar title. My project heavily relies on AJAX, with most responses returning either 'error' or 'success' messages in an array. In my Javascript code, I display these messages in a custom notification bar.
I'm unsure about the best practice for handling errors. When it comes to checking the PDO query for success or failure in the return array, I don't know whether to rely on the boolean value returned by execute()
, or if I should implement a try/catch block.
Is there a significant difference in error handling methods?