summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2004-09-24 18:49:33 +0000
committerWez Furlong <wez@php.net>2004-09-24 18:49:33 +0000
commit2416481fd15c86d9a5908b291e58b839e754e019 (patch)
tree7b4982cfe183c9294cbc41cd773385e5f14dea8b /ext
parentac5b702b9189097d0fa69f544d4b972ee9c69f80 (diff)
downloadphp-git-2416481fd15c86d9a5908b291e58b839e754e019.tar.gz
More sensible error codes in the exceptions we throw for broken transactions
Diffstat (limited to 'ext')
-rwxr-xr-xext/pdo/pdo_dbh.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
index 97c6ce45b3..8d38327f97 100755
--- a/ext/pdo/pdo_dbh.c
+++ b/ext/pdo/pdo_dbh.c
@@ -378,14 +378,14 @@ static PHP_METHOD(PDO, beginTransaction)
pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
if (dbh->in_txn) {
- zend_throw_exception_ex(php_pdo_get_exception(), PDO_ERR_NONE TSRMLS_CC, "There is already an active transaction");
+ zend_throw_exception_ex(php_pdo_get_exception(), PDO_ERR_ALREADY_EXISTS TSRMLS_CC, "There is already an active transaction");
RETURN_FALSE;
}
if (!dbh->methods->begin) {
/* TODO: this should be an exception; see the auto-commit mode
* comments below */
- zend_throw_exception_ex(php_pdo_get_exception(), PDO_ERR_NONE TSRMLS_CC, "This driver doesn't support transactions");
+ zend_throw_exception_ex(php_pdo_get_exception(), PDO_ERR_NOT_IMPLEMENTED TSRMLS_CC, "This driver doesn't support transactions");
RETURN_FALSE;
}
@@ -427,7 +427,7 @@ static PHP_METHOD(PDO, rollBack)
pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
if (!dbh->in_txn) {
- zend_throw_exception_ex(php_pdo_get_exception(), PDO_ERR_NONE TSRMLS_CC, "There is no active transaction");
+ zend_throw_exception_ex(php_pdo_get_exception(), PDO_ERR_NOT_FOUND TSRMLS_CC, "There is no active transaction");
RETURN_FALSE;
}