Skip to content

Commit 9b2ca17

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

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Wrapper/JaegerConnectionWrapper.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ public function connect()
4848
->addTag(new ErrorTag());
4949
throw $e;
5050
} finally {
51-
$this->tracer->finish($span->addTag(new DbType($this->getDatabasePlatform()->getName())));
51+
if ($this->isConnected()) {
52+
$span->addTag(new DbType($this->getDatabasePlatform()->getName()));
53+
}
54+
$this->tracer->finish($span);
5255
}
5356
}
5457

0 commit comments

Comments
 (0)