diff --git a/src/Common/EntityResolver.php b/src/Common/EntityResolver.php index 2d27d77..f70b502 100644 --- a/src/Common/EntityResolver.php +++ b/src/Common/EntityResolver.php @@ -39,7 +39,7 @@ class EntityResolver { public function field($name, $fieldKey = self::KEY_ENTITY_NAME, $throwException = true) : ? array { try{ - return $this->fieldList($fieldKey)[$name]; + return $this->fieldList($fieldKey)[$name] ?? null; } catch(\Throwable $e) { if ( $throwException) { diff --git a/src/Common/PdoObject.php b/src/Common/PdoObject.php index e9af73a..94a4208 100644 --- a/src/Common/PdoObject.php +++ b/src/Common/PdoObject.php @@ -46,12 +46,13 @@ class PdoObject extends PDO { } return $statement; - } + } else { throw new \PDOException($statement->errorCode() . " - " . json_encode($statement->errorInfo())); } } catch (\PDOException $e) { $this->rollback(); + throw $e; }