Skip to content

Commit

Permalink
Avoid the hook frame in mysqli connection error tracking (#2937)
Browse files Browse the repository at this point in the history
Otherwise the error stems from "Mysqli/MysqliIntegration.php:379" which may be confusing and seemingly hint at a problem in our integrations.
  • Loading branch information
bwoebi authored Nov 8, 2024
1 parent 330d8a4 commit 68f8558
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/DDTrace/Integrations/Mysqli/MysqliIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,9 @@ public function trackPotentialError(SpanData $span)
{
$errorCode = mysqli_connect_errno();
if ($errorCode > 0) {
$span->exception = new \Exception(mysqli_connect_error());
$span->meta[Tag::ERROR_MSG] = mysqli_connect_error();
$span->meta[Tag::ERROR_TYPE] = 'mysqli error';
$span->meta[Tag::ERROR_STACK] = \DDTrace\get_sanitized_exception_trace(new \Exception, 2);
}
}
}

0 comments on commit 68f8558

Please sign in to comment.