Skip to content

Commit 8cf5c89

Browse files
authored
Fix support for PDOExceptions (#1752)
When a PDOException is thrown (ex. Illuminate's QueryException) during the initialization of a Collector, the current code falls over because the code property on PDOExceptions are actually strings, and not ints. See [this comment from 15 years ago](https://www.php.net/manual/en/class.pdoexception.php#95812), php/php-src#9529, & php/php-src#12294
1 parent 4b07d9f commit 8cf5c89

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/LaravelDebugbar.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ protected function addCollectorException(string $message, Exception $exception)
754754
$this->addThrowable(
755755
new Exception(
756756
$message . ' on Laravel Debugbar: ' . $exception->getMessage(),
757-
$exception->getCode(),
757+
(int) $exception->getCode(),
758758
$exception
759759
)
760760
);

0 commit comments

Comments
 (0)