Skip to content

Commit

Permalink
Exception: Fixed isssue causing notice when error has no message defi…
Browse files Browse the repository at this point in the history
…ned.
  • Loading branch information
skipperbent committed Feb 18, 2023
1 parent 0b07588 commit 77749ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Pecee/Pixie/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ public static function create(\Exception $e, string $adapterName = null, QueryOb
* @var integer|null $errorCode
* @var string|null $errorMsg
*/
[$errorSqlState, $errorCode, $errorMsg] = $e->errorInfo;
$errorSqlState = $e->errorInfo[0] ?? null;
$errorCode = $e->errorInfo[1] ?? 0;
$errorMsg = $e->errorInfo[2] ?? null;

$errorMsg = $errorMsg ?? $e->getMessage();
$errorCode = (int)($errorCode ?? $e->getCode());
Expand Down

0 comments on commit 77749ea

Please sign in to comment.