php - Get all the exceptions from one try catch block -
i wonder if it's posible exceptions throwed.
public function test() { $arrayexceptions = array(); try { throw new exception('division zero.'); throw new exception('this never throwed'); } catch (exception $e) { $arrayexceptions[] = $e; } }
i have huge try catch block want know errors, not first throwed. possible maybe more 1 try or or doing wrong?
thank you
you wrote yourself: "this never throwed" [sic].
because exception never thrown, cannot catch it. there 1 exception because after 1 exception thrown, whole block abandoned , no further code in executed. hence no second exception.
Comments
Post a Comment