Skip to content

Commit f07e071

Browse files
committed
"Re-tag" when capturing to Sentry
There may have been changes after Sentry was initialised first, so re-run `setTags()` when sending events to Sentry.
1 parent 6e93aff commit f07e071

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Classes/SentryClient.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ public function captureThrowable(Throwable $throwable, array $extraData = [], ar
189189

190190
$captureException = (!in_array(get_class($throwable), $this->excludeExceptionTypes, true));
191191
if ($captureException) {
192+
$this->setTags();
192193
$this->configureScope($extraData, $tags);
193194
if ($throwable instanceof Exception && $throwable->getStatusCode() === 404) {
194195
SentrySdk::getCurrentHub()->configureScope(static function (Scope $scope): void {
@@ -225,6 +226,7 @@ public function captureMessage(string $message, Severity $severity, array $extra
225226
$eventHint = EventHint::fromArray([
226227
'stacktrace' => $this->prepareStacktrace()
227228
]);
229+
$this->setTags();
228230
$sentryEventId = \Sentry\captureMessage($message, $severity, $eventHint);
229231

230232
if ($this->logger) {

0 commit comments

Comments
 (0)