Skip to content

Catch all errors thrown from commands #186

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

Merged
merged 8 commits into from
Jun 24, 2025

Conversation

indykoning
Copy link
Member

Summary

closes: #100

This PR will wrap commands with the GlobalExceptionCatcher as well, causing exceptions and logs thrown by commands to be sent to Sentry as well.

This will make it so failed commands get tracked, but failed consumers as well.

Checklist

  • I've ran composer run codestyle
  • I've ran composer run analyse

@jbclaudio jbclaudio requested a review from Copilot June 24, 2025 07:07
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR extends Sentry error tracking by wrapping command executions with a global exception catcher so that errors from both commands and consumers are reported.

  • Adds a plugin definition for the Symfony Console Command in etc/di.xml
  • Updates GlobalExceptionCatcher to support variadic arguments for both launch and run methods
  • Updates SentryPerformance to accept a union type for command and app handling

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
etc/di.xml Adds a new plugin configuration for handling CLI command exceptions
Plugin/GlobalExceptionCatcher.php Updates method signatures to support variadic parameters and adds command exception handling
Model/SentryPerformance.php Adjusts type hints to accept both Command and AppInterface as inputs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@indykoning indykoning merged commit 3e4a4ed into master Jun 24, 2025
10 checks passed
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.

Exceptions in Consumers are not sent to Sentry
4 participants