Is it best practice to try - catch my entire PHP code, or be as specific as possible?

Posted by Itay Moav on Stack Overflow See other posts from Stack Overflow or by Itay Moav
Published on 2010-05-14T01:09:19Z Indexed on 2010/05/14 1:14 UTC
Read the original article Hit count: 248

I do not have many kinds of Exceptions in my project.
Right now,(we use MVC) I have the try catch encompassing my entire code:

try{
   fronController::dispatch($somthing...);
}catch(Exception $E){
  //handle errors
}

I wonder if there is a good reason to use the try-catch block in as specific as possible way as I can or just keep it general as it is now?

© Stack Overflow or respective owner

Related posts about php

Related posts about try-catch