From: Wez Furlong Date: Tue, 25 May 2004 12:03:41 +0000 (+0000) Subject: Throw exception during ctor X-Git-Tag: php-5.0.0RC3RC1~56 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e6551f081d93e712eadcfee82c96e307cbb9ec25;p=php Throw exception during ctor --- diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c index 6cb2dde99c..037f6ffea3 100755 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@ -116,6 +116,11 @@ int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int lin break; } + if (!dbh->methods) { + zend_throw_exception_ex(php_pdo_get_exception(), *pdo_err TSRMLS_CC, "[%d] %s", + einfo->errcode, einfo->errmsg); + } + return einfo->errcode; } /* }}} */