You should not throw anything into catch . If you do, you can drop this inner layer of try-catch and catch exceptions into the outer layer of try-catch and handle this exception.
eg:
try { function(){ try { function(){ try { function (){} } catch { throw new Exception("newInner"); } } } catch { throw new Exception("new"); } } } catch (Exception $e) { echo $e; }
can be replaced by
try { function(){ function(){ function (){ throw new Exception("newInner"); } } } } catch (Exception $e) { echo $e; }
source share