Skip to content

Commit

Permalink
Set status for console command transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
rodion-k authored Nov 4, 2024
1 parent 5f8da13 commit f7f6ef2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/EventListener/TracingConsoleListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public function handleConsoleTerminateEvent(ConsoleTerminateEvent $event): void
$span = $this->hub->getSpan();

if (null !== $span) {
$span->setStatus($event->getExitCode() === 0 ? SpanStatus::ok() : SpanStatus::internalError());

Check failure on line 96 in src/EventListener/TracingConsoleListener.php

View workflow job for this annotation

GitHub Actions / PHPStan

Call to static method internalError() on an unknown class Sentry\SentryBundle\EventListener\SpanStatus.

Check failure on line 96 in src/EventListener/TracingConsoleListener.php

View workflow job for this annotation

GitHub Actions / PHPStan

Call to static method ok() on an unknown class Sentry\SentryBundle\EventListener\SpanStatus.

Check failure on line 96 in src/EventListener/TracingConsoleListener.php

View workflow job for this annotation

GitHub Actions / Psalm

UndefinedClass

src/EventListener/TracingConsoleListener.php:96:60: UndefinedClass: Class, interface or enum named Sentry\SentryBundle\EventListener\SpanStatus does not exist (see https://psalm.dev/019)
$span->finish();
}
}
Expand Down

0 comments on commit f7f6ef2

Please sign in to comment.