From 77749ea76da8e1e0e4bd02e967a74dee2a54cd00 Mon Sep 17 00:00:00 2001 From: sessingo Date: Sat, 18 Feb 2023 19:54:53 +0100 Subject: [PATCH] Exception: Fixed isssue causing notice when error has no message defined. --- src/Pecee/Pixie/Exception.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Pecee/Pixie/Exception.php b/src/Pecee/Pixie/Exception.php index 880a2f2..88d08fc 100644 --- a/src/Pecee/Pixie/Exception.php +++ b/src/Pecee/Pixie/Exception.php @@ -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());