public static function databaseError($errorMessage, $errorCode) { return new static(sprintf('%s (error code %s)', $errorMessage, $errorCode)); }
private function doQuery($query) { $result = $this->db->query($query); if ($this->db->lastErrorCode() > 0) { throw StorageException::databaseError($this->db->lastErrorMsg(), $this->db->lastErrorCode()); } return $result; }