Skip to content

Commit 5042696

Browse files
committed
Do not trigger exception in finally
1 parent 9b2ca17 commit 5042696

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/Wrapper/JaegerConnectionWrapper.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,7 @@ public function connect()
3535
if ($this->isConnected()) {
3636
return;
3737
}
38-
$span = $this->tracer
39-
->start('dbal.connect')
40-
->addTag(new DbInstanceTag($this->getDatabase()))
41-
->addTag(new DbUser($this->getUsername()))
42-
->addTag(new DbalAutoCommitTag($this->isAutoCommit()))
43-
->addTag(new DbalNestingLevelTag($this->getTransactionNestingLevel()));
38+
$span = $this->tracer->start('dbal.connect');
4439
try {
4540
parent::connect();
4641
} catch (\Exception $e) {
@@ -49,7 +44,11 @@ public function connect()
4944
throw $e;
5045
} finally {
5146
if ($this->isConnected()) {
52-
$span->addTag(new DbType($this->getDatabasePlatform()->getName()));
47+
$span->addTag(new DbInstanceTag($this->getDatabase()))
48+
->addTag(new DbUser($this->getUsername()))
49+
->addTag(new DbalAutoCommitTag($this->isAutoCommit()))
50+
->addTag(new DbalNestingLevelTag($this->getTransactionNestingLevel()))
51+
->addTag(new DbType($this->getDatabasePlatform()->getName()));
5352
}
5453
$this->tracer->finish($span);
5554
}

0 commit comments

Comments
 (0)