Php/カスタムexception
提供: 初心者エンジニアの簡易メモ
サンプル
function exception_handler($exception) {
echo "Uncaught exception: " , $exception->getMessage(), "\n";
mail(
"hoge@example.com",
$exception->getMessage(),
$exception->__toString()
);
}
set_exception_handler('exception_handler');
throw new Exception('Uncaught Exception');
echo "Not Executed\n";
