From c1f8dddb3ae91ecb1ef7e7cde15f0e4866c1bc62 Mon Sep 17 00:00:00 2001 From: zYne Date: Wed, 1 Nov 2006 10:04:04 +0000 Subject: [PATCH] Fixes #214, added exception classes for all drivers --- lib/Doctrine/Connection/Exception.php | 34 ++++++++++++++----- .../Connection/Firebird/Exception.php | 29 ++++++++++++++++ lib/Doctrine/Connection/Informix/Informix.php | 29 ++++++++++++++++ lib/Doctrine/Connection/Mssql/Mssql.php | 29 ++++++++++++++++ lib/Doctrine/Connection/Mysql/Exception.php | 29 ++++++++++++++++ lib/Doctrine/Connection/Oracle/Exception.php | 29 ++++++++++++++++ lib/Doctrine/Connection/Pgsql/Exception.php | 29 ++++++++++++++++ lib/Doctrine/Connection/Sqlite/Sqlite.php | 29 ++++++++++++++++ 8 files changed, 228 insertions(+), 9 deletions(-) create mode 100644 lib/Doctrine/Connection/Firebird/Exception.php create mode 100644 lib/Doctrine/Connection/Informix/Informix.php create mode 100644 lib/Doctrine/Connection/Mssql/Mssql.php create mode 100644 lib/Doctrine/Connection/Mysql/Exception.php create mode 100644 lib/Doctrine/Connection/Oracle/Exception.php create mode 100644 lib/Doctrine/Connection/Pgsql/Exception.php create mode 100644 lib/Doctrine/Connection/Sqlite/Sqlite.php diff --git a/lib/Doctrine/Connection/Exception.php b/lib/Doctrine/Connection/Exception.php index 8b967f6ba..eae42f278 100644 --- a/lib/Doctrine/Connection/Exception.php +++ b/lib/Doctrine/Connection/Exception.php @@ -1,13 +1,29 @@ . + */ Doctrine::autoload('Doctrine_Exception'); /** - * thrown when user tries to get the current - * connection and there are no open connections + * Doctrine_Exception + * + * @package Doctrine ORM + * @url www.phpdoctrine.com + * @license LGPL */ -class Doctrine_Connection_Exception extends Doctrine_Exception { - public function __construct() { - parent::__construct("There are no opened connections. Use - Doctrine_Manager::getInstance()->openConnection() to open a new connection.",Doctrine::ERR_NO_SESSIONS); - } -} - +class Doctrine_Connection_Exception extends Doctrine_Exception { } diff --git a/lib/Doctrine/Connection/Firebird/Exception.php b/lib/Doctrine/Connection/Firebird/Exception.php new file mode 100644 index 000000000..3fc9271ef --- /dev/null +++ b/lib/Doctrine/Connection/Firebird/Exception.php @@ -0,0 +1,29 @@ +. + */ +Doctrine::autoload('Doctrine_Connection_Exception'); +/** + * Doctrine_Connection_Firebird_Exception + * + * @package Doctrine ORM + * @url www.phpdoctrine.com + * @license LGPL + */ +class Doctrine_Connection_Firebird_Exception extends Doctrine_Connection_Exception { } diff --git a/lib/Doctrine/Connection/Informix/Informix.php b/lib/Doctrine/Connection/Informix/Informix.php new file mode 100644 index 000000000..61168e15e --- /dev/null +++ b/lib/Doctrine/Connection/Informix/Informix.php @@ -0,0 +1,29 @@ +. + */ +Doctrine::autoload('Doctrine_Connection_Exception'); +/** + * Doctrine_Connection_Informix_Exception + * + * @package Doctrine ORM + * @url www.phpdoctrine.com + * @license LGPL + */ +class Doctrine_Connection_Informix_Exception extends Doctrine_Connection_Exception { } diff --git a/lib/Doctrine/Connection/Mssql/Mssql.php b/lib/Doctrine/Connection/Mssql/Mssql.php new file mode 100644 index 000000000..6af4ce15e --- /dev/null +++ b/lib/Doctrine/Connection/Mssql/Mssql.php @@ -0,0 +1,29 @@ +. + */ +Doctrine::autoload('Doctrine_Connection_Exception'); +/** + * Doctrine_Connection_Mssql_Exception + * + * @package Doctrine ORM + * @url www.phpdoctrine.com + * @license LGPL + */ +class Doctrine_Connection_Mssql_Exception extends Doctrine_Connection_Exception { } diff --git a/lib/Doctrine/Connection/Mysql/Exception.php b/lib/Doctrine/Connection/Mysql/Exception.php new file mode 100644 index 000000000..e97f057da --- /dev/null +++ b/lib/Doctrine/Connection/Mysql/Exception.php @@ -0,0 +1,29 @@ +. + */ +Doctrine::autoload('Doctrine_Connection_Exception'); +/** + * Doctrine_Connection_Mysql_Exception + * + * @package Doctrine ORM + * @url www.phpdoctrine.com + * @license LGPL + */ +class Doctrine_Connection_Mysql_Exception extends Doctrine_Connection_Exception { } diff --git a/lib/Doctrine/Connection/Oracle/Exception.php b/lib/Doctrine/Connection/Oracle/Exception.php new file mode 100644 index 000000000..84c070f01 --- /dev/null +++ b/lib/Doctrine/Connection/Oracle/Exception.php @@ -0,0 +1,29 @@ +. + */ +Doctrine::autoload('Doctrine_Connection_Exception'); +/** + * Doctrine_Connection_Oracle_Exception + * + * @package Doctrine ORM + * @url www.phpdoctrine.com + * @license LGPL + */ +class Doctrine_Connection_Oracle_Exception extends Doctrine_Connection_Exception { } diff --git a/lib/Doctrine/Connection/Pgsql/Exception.php b/lib/Doctrine/Connection/Pgsql/Exception.php new file mode 100644 index 000000000..583431ab8 --- /dev/null +++ b/lib/Doctrine/Connection/Pgsql/Exception.php @@ -0,0 +1,29 @@ +. + */ +Doctrine::autoload('Doctrine_Connection_Exception'); +/** + * Doctrine_Connection_Pgsql_Exception + * + * @package Doctrine ORM + * @url www.phpdoctrine.com + * @license LGPL + */ +class Doctrine_Connection_Pgsql_Exception extends Doctrine_Connection_Exception { } diff --git a/lib/Doctrine/Connection/Sqlite/Sqlite.php b/lib/Doctrine/Connection/Sqlite/Sqlite.php new file mode 100644 index 000000000..afabf31da --- /dev/null +++ b/lib/Doctrine/Connection/Sqlite/Sqlite.php @@ -0,0 +1,29 @@ +. + */ +Doctrine::autoload('Doctrine_Connection_Exception'); +/** + * Doctrine_Connection_Sqlite_Exception + * + * @package Doctrine ORM + * @url www.phpdoctrine.com + * @license LGPL + */ +class Doctrine_Connection_Sqlite_Exception extends Doctrine_Connection_Exception { }