Skip to content

Commit

Permalink
Take all http_* options from the Laravel client in the test command (
Browse files Browse the repository at this point in the history
  • Loading branch information
stayallive committed Mar 5, 2024
1 parent 2c70e34 commit 1b7fc23
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions src/Sentry/Laravel/Console/TestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,27 @@ public function handle(): int
return 1;
}

try {
$clientBuilder = ClientBuilder::create([
'dsn' => $dsn,
'release' => $laravelClient === null ? null : $laravelClient->getOptions()->getRelease(),
'environment' => $laravelClient === null ? null : $laravelClient->getOptions()->getEnvironment(),
'traces_sample_rate' => 1.0,
$options = [
'dsn' => $dsn,
'traces_sample_rate' => 1.0,
];

if ($laravelClient !== null) {
$options = array_merge($options, [
'release' => $laravelClient->getOptions()->getRelease(),
'environment' => $laravelClient->getOptions()->getEnvironment(),
'http_client' => $laravelClient->getOptions()->getHttpClient(),
'http_proxy' => $laravelClient->getOptions()->getHttpProxy(),
'http_proxy_authentication' => $laravelClient->getOptions()->getHttpProxyAuthentication(),
'http_connect_timeout' => $laravelClient->getOptions()->getHttpConnectTimeout(),
'http_timeout' => $laravelClient->getOptions()->getHttpTimeout(),
'http_ssl_verify_peer' => $laravelClient->getOptions()->getHttpSslVerifyPeer(),
'http_compression' => $laravelClient->getOptions()->isHttpCompressionEnabled(),
]);
}

try {
$clientBuilder = ClientBuilder::create($options);
} catch (Exception $e) {
$this->error($e->getMessage());

Expand Down

0 comments on commit 1b7fc23

Please sign in to comment.