Skip to content

Commit cea7ba0

Browse files
authored
[9.x] Allow passing closure to rescue $report parameter (#44710)
* Update helpers.php * Update helpers.php * Update helpers.php
1 parent 56a0bdf commit cea7ba0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Illuminate/Foundation/helpers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,15 +711,15 @@ function request($key = null, $default = null)
711711
*
712712
* @param callable $callback
713713
* @param mixed $rescue
714-
* @param bool $report
714+
* @param bool|callable $report
715715
* @return mixed
716716
*/
717717
function rescue(callable $callback, $rescue = null, $report = true)
718718
{
719719
try {
720720
return $callback();
721721
} catch (Throwable $e) {
722-
if ($report) {
722+
if (value($report, $e)) {
723723
report($e);
724724
}
725725

0 commit comments

Comments
 (0)