From 84de1ea7c0bdd4f2c4143215d4e1407283d01e75 Mon Sep 17 00:00:00 2001 From: Robin van der Vleuten Date: Sun, 26 May 2019 13:46:11 +0200 Subject: [PATCH] Allow rescued exception reporting to be disabled --- src/Illuminate/Foundation/helpers.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php index 068f48a169da..76fc9e1f4af5 100644 --- a/src/Illuminate/Foundation/helpers.php +++ b/src/Illuminate/Foundation/helpers.php @@ -703,14 +703,17 @@ function request($key = null, $default = null) * * @param callable $callback * @param mixed $rescue + * @param bool $report * @return mixed */ - function rescue(callable $callback, $rescue = null) + function rescue(callable $callback, $rescue = null, $report = true) { try { return $callback(); } catch (Throwable $e) { - report($e); + if ($report) { + report($e); + } return value($rescue); }