1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-11 08:34:59 +02:00

* throwing exception in DibiTranslator and DibiDriver

+ added dibi::$errorMode
This commit is contained in:
David Grudl
2006-11-22 12:55:24 +00:00
parent f447a03c96
commit 3b8766d376
17 changed files with 95 additions and 58 deletions

View File

@@ -7,7 +7,7 @@
* This source file is subject to the GNU GPL license.
*
* @author David Grudl aka -dgx- <dave@dgx.cz>
* @link http://texy.info/dibi/
* @link http://dibi.texy.info/
* @copyright Copyright (c) 2005-2006 David Grudl
* @license GNU GENERAL PUBLIC LICENSE v2
* @package dibi
@@ -111,7 +111,7 @@ class DibiMySqlDriver extends DibiDriver {
return new DibiMySqlResult($res);
if ($res === FALSE)
return new DibiException("Query error", array(
throw new DibiException("Query error", array(
'message' => mysql_error($this->conn),
'code' => mysql_errno($this->conn),
'sql' => $sql,

View File

@@ -7,7 +7,7 @@
* This source file is subject to the GNU GPL license.
*
* @author David Grudl aka -dgx- <dave@dgx.cz>
* @link http://texy.info/dibi/
* @link http://dibi.texy.info/
* @copyright Copyright (c) 2005-2006 David Grudl
* @license GNU GENERAL PUBLIC LICENSE v2
* @package dibi
@@ -78,7 +78,7 @@ class DibiMySqliDriver extends DibiDriver {
return new DibiMySqliResult($res);
if ($res === FALSE)
return new DibiException("Query error", $this->errorInfo($sql));
throw new DibiException("Query error", $this->errorInfo($sql));
$this->affectedRows = mysqli_affected_rows($this->conn);
if ($this->affectedRows < 0) $this->affectedRows = FALSE;

View File

@@ -7,7 +7,7 @@
* This source file is subject to the GNU GPL license.
*
* @author David Grudl aka -dgx- <dave@dgx.cz>
* @link http://texy.info/dibi/
* @link http://dibi.texy.info/
* @copyright Copyright (c) 2005-2006 David Grudl
* @license GNU GENERAL PUBLIC LICENSE v2
* @package dibi
@@ -79,7 +79,7 @@ class DibiOdbcDriver extends DibiDriver {
return new DibiOdbcResult($res);
if ($res === FALSE)
return new DibiException("Query error", $this->errorInfo($sql));
throw new DibiException("Query error", $this->errorInfo($sql));
$this->affectedRows = odbc_num_rows($this->conn);
if ($this->affectedRows < 0) $this->affectedRows = FALSE;

View File

@@ -7,12 +7,12 @@
* This source file is subject to the GNU GPL license.
*
* @author David Grudl aka -dgx- <dave@dgx.cz>
* @link http://texy.info/dibi/
* @link http://dibi.texy.info/
* @copyright Copyright (c) 2005-2006 David Grudl
* @license GNU GENERAL PUBLIC LICENSE v2
* @package dibi
* @category Database
* @version $Revision: 17 $ $Date: 2006-08-25 20:10:30 +0200 (pá, 25 VIII 2006) $
* @version $Revision$ $Date$
*/
@@ -84,7 +84,7 @@ class DibiPostgreDriver extends DibiDriver {
return new DibiPostgreResult($res);
if ($res === FALSE)
return new DibiException("Query error", array(
throw new DibiException("Query error", array(
'message' => pg_last_error($this->conn),
'sql' => $sql,
));

View File

@@ -7,7 +7,7 @@
* This source file is subject to the GNU GPL license.
*
* @author David Grudl aka -dgx- <dave@dgx.cz>
* @link http://texy.info/dibi/
* @link http://dibi.texy.info/
* @copyright Copyright (c) 2005-2006 David Grudl
* @license GNU GENERAL PUBLIC LICENSE v2
* @package dibi
@@ -78,7 +78,7 @@ class DibiSqliteDriver extends DibiDriver {
$res = @sqlite_query($this->conn, $sql, SQLITE_ASSOC, $errorMsg);
if ($res === FALSE)
return new DibiException("Query error", array(
throw new DibiException("Query error", array(
'message' => $errorMsg,
'sql' => $sql,
));