Skip to content

Commit

Permalink
Fix not setting correct SDK ID/version when running test command
Browse files Browse the repository at this point in the history
  • Loading branch information
stayallive committed Oct 6, 2022
1 parent cad98d8 commit 6a3fa07
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Sentry/Laravel/Console/TestCommand.php
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6a3fa07

Please sign in to comment.