#!/usr/bin/php "tester l'affichage des exception", "merge" => parent::ARGS, ]; function fart(): void { throw new RuntimeException("fart"); } function prout(): void { try { $this->fart(); } catch (Exception $e) { throw new RuntimeException("prout", $e->getCode(), $e); } } function main() { try { throw new Exception("exception normale"); } catch (Exception $e) { msg::info("summary: ". exceptions::get_summary($e)); msg::error($e); } try { try { $this->prout(); } catch (Exception $e) { throw new Exception("exception normale", $e->getCode(), $e); } } catch (Exception $e) { msg::info("summary: ". exceptions::get_summary($e)); msg::error($e); } try { throw exceptions::invalid_value("valeur", $kind) ->setTechMessage("message technique"); } catch (Exception $e) { msg::info("summary: ". exceptions::get_summary($e)); msg::error($e); } try { try { $this->prout(); } catch (Exception $e) { throw exceptions::invalid_value("valeur", $kind, null, $e) ->setTechMessage("message technique"); } } catch (Exception $e) { msg::info("summary: ". exceptions::get_summary($e)); msg::error($e); } } });