Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] Fix bug with error handling in closure scheduled tasks #34420

Merged

Conversation

jszobody
Copy link
Contributor

This PR fixes a bug with #33914. Previously I was setting the exitCode at the end, right before returning $response. This means though that the afterCallbacks including onSuccess and onFailure were run before the exit code was set. Oops.

parent::callAfterCallbacks($container);
}
$this->exitCode = $response === false ? 1 : 0;

This PR moves just the one line of code so that the exitCode is set right away, inside the main try block. I've also updated the integration test to actually test with callbacks, instead of just checking the exitCode.

@taylorotwell taylorotwell merged commit 730d6c8 into laravel:8.x Sep 20, 2020
@jszobody jszobody deleted the fix-callback-event-failure-handling branch September 20, 2020 20:49
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.

None yet

2 participants