throw;

Avoid

try{
    ...
}catch( Exception exc ){
    ...
 throw exc;
}

since it destroys the exception stack.

Instead write

try{
    ...
}catch( Exception ){
    ...
 throw;
}

If you don’t understand what “destroying the exception stack” means you probably don’t want to destroy it and this recommendation is even more something to heed.

To get to the exception use $exception.

Tags: , ,

Leave a Reply