Re: Continued try blocks

From: Date: Sat, 27 Apr 2013 14:26:19 +0000
Subject: Re: Continued try blocks
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-67182@lists.php.net to get a copy of this message
Sorry but I disagree, I think you're approaching try-catch wrong. You shouldn't have a try-catch that *can* continue on the next line after the throw. What you should do is have decoupled code that handles _their own exceptions_ nicely and either cleans up after itself else it rethrows the exception/a new one. Any top level try-catch is supposed to be a control structure with one of two chances: either lines 1-N go smoothly and no exceptions are thrown, or Exception_X is thrown and you clean up on it's catch block... Also remember that you have the finally block.

« previous php.internals (#67182) next »