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

Capture all messenger exceptions #340

Merged
merged 6 commits into from May 7, 2020
Merged

Capture all messenger exceptions #340

merged 6 commits into from May 7, 2020

Conversation

emarref
Copy link
Contributor

@emarref emarref commented May 7, 2020

When a command has multiple handlers, if any of those handlers throw an error, other handlers will continue. Multiple handlers may throw errors. This PR ensures all thrown errors are captured.

Addresses #338

@Jean85 Jean85 added this to the 3.5 milestone May 7, 2020
Copy link
Collaborator

@Jean85 Jean85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix looks fine, apart from a small check

src/EventListener/MessengerListener.php Show resolved Hide resolved
Copy link
Collaborator

@Jean85 Jean85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check unneeded, LGTM! 👍

@Jean85 Jean85 merged commit 48455a5 into getsentry:master May 7, 2020
Jean85 added a commit that referenced this pull request May 7, 2020
sh41 added a commit to sh41/sentry-symfony that referenced this pull request May 7, 2020
sh41 added a commit to sh41/sentry-symfony that referenced this pull request May 7, 2020
Jean85 pushed a commit that referenced this pull request May 7, 2020
* Alter MessengerListener to use current hub with methods for capturing exception and accessing client. This allows the scope of the current hub to be updated in a prior event listener.

* Inject the hub rather than rely upon singleton instance.

* Correctly typehint and remove phpstan exclusions for the MessengerListenerTest properties.

* Merge changes from #340.

* Fix up new test.

Co-authored-by: Steve Hall <steve.hall+gitlab@rg456.co.uk>
@Jean85 Jean85 mentioned this pull request May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HandlerFailedException could wrap multiple exceptions
2 participants