Skip to content

[9.x] Allow passing closure to rescue $report parameter#44710

Merged
taylorotwell merged 3 commits into
laravel:9.xfrom
foremtehan:patch-8
Oct 24, 2022
Merged

[9.x] Allow passing closure to rescue $report parameter#44710
taylorotwell merged 3 commits into
laravel:9.xfrom
foremtehan:patch-8

Conversation

@foremtehan

@foremtehan foremtehan commented Oct 24, 2022

Copy link
Copy Markdown
Contributor

Allow closures to be pass in rescue function for $report paramter so we can conditionally report the error base on the exception type or etc ... (if accepted i'll add tests later)

rescue(fn() => 'error', fn() => 'rescue', function(Throwable $e){
    return $e instanceof SomeException;
});

@foremtehan foremtehan changed the title [9.x] Allow passing closure to rescure report parameter [9.x] Allow passing closure to rescue report parameter Oct 24, 2022
@foremtehan foremtehan changed the title [9.x] Allow passing closure to rescue report parameter [9.x] Allow passing closure to rescue $report parameter Oct 24, 2022
@taylorotwell taylorotwell merged commit cea7ba0 into laravel:9.x Oct 24, 2022
@foremtehan foremtehan deleted the patch-8 branch October 24, 2022 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants