diff --git a/src/Sentry/Laravel/Console/TestCommand.php b/src/Sentry/Laravel/Console/TestCommand.php index 0623d5fd..4ce0416f 100644 --- a/src/Sentry/Laravel/Console/TestCommand.php +++ b/src/Sentry/Laravel/Console/TestCommand.php @@ -7,6 +7,7 @@ use Illuminate\Support\Str; use Psr\Log\AbstractLogger; use Sentry\ClientBuilder; +use Sentry\Laravel\Version; use Sentry\State\Hub; use Sentry\State\HubInterface; use Sentry\Tracing\SpanContext; @@ -93,12 +94,17 @@ public function handle(): int 'environment' => $laravelClient === null ? null : $laravelClient->getOptions()->getEnvironment(), 'traces_sample_rate' => 1.0, ]); + } catch (Exception $e) { $this->error($e->getMessage()); return 1; } + // Set the Laravel SDK identifier and version + $clientBuilder->setSdkIdentifier(Version::SDK_IDENTIFIER); + $clientBuilder->setSdkVersion(Version::SDK_VERSION); + // We set a logger so we can surface errors thrown internally by the SDK $clientBuilder->setLogger(new class($this) extends AbstractLogger { private $command;