From 9578e43722a47eb6920547553bd79e8a30457c74 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Wed, 29 May 2013 13:57:08 -0400 Subject: [PATCH] set error mode in pdo constructor --- classes/db_pdo.php | 5 ++--- tests/db_files/FB_TEST_DB.FDB | Bin 802816 -> 802816 bytes 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/classes/db_pdo.php b/classes/db_pdo.php index 037419a..de6f805 100644 --- a/classes/db_pdo.php +++ b/classes/db_pdo.php @@ -51,6 +51,8 @@ abstract class DB_PDO extends PDO { */ public function __construct($dsn, $username=NULL, $password=NULL, $driver_options=array()) { + // Set PDO to display errors as exceptions + $driver_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION; parent::__construct($dsn, $username, $password, $driver_options); // Load the sql class for the driver @@ -61,9 +63,6 @@ abstract class DB_PDO extends PDO { $class = get_class($this)."_util"; $this->util = new $class($this); - // Set PDO to display errors as exceptions - $this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - // Set additional driver options, if they exist if ( ! empty($driver_options) && is_array($driver_options)) { diff --git a/tests/db_files/FB_TEST_DB.FDB b/tests/db_files/FB_TEST_DB.FDB index 15e8f662fffde806f2313aacb53c885a3cddf461..d10160c9861c119eb50c5e47382fb471da5952bf 100755 GIT binary patch delta 427 zcmY*VJxc>Y5S_gwYIZKkiWV_~H#TbSiHSeaMekeBev^Rbj%c)Tk2vB^0(#x4 ziDnyXlCN2~En&sRjQBjm;=h@Rg;jDP-c4K+lVj8hGxPy=wMffPgI`7YEC_x> zK~sBF^cow4rYNF8Z0%2I4D9Dq>yEn*-@D@r$9bCb^eThQY%2->LCAf5)n(lVI8_Cp zv5Pjq`uuC+GtxUC&{UQ^!Bnr?cd_!VRU<)6kS53{$S+72G$d$P(1@VG0~vl|XRaPK z<_tG8Z9MA-os{8rQm7Y7S*_A*^QKp(%J% z^%OGUQgJtALqTy->2N6SS$zae2%5IMaxm^5a{LL5R@76E-jYE#E3#O{HCB<=3fSHD zLzb$TSMz)ga|%Z_T-Ma}P6Jc2<=_O{ld*lwB?pF@XGbv5eow=nw%nH!EHe3ijA6Op a;F5GW&d5y%$7R#OE!pN6akC9<-uwdpXICZw