Have PDO errors throw an exception
This commit is contained in:
parent
bde5082805
commit
50569c4f26
@ -25,6 +25,7 @@ class Database
|
|||||||
$dsn = "mysql:host={$args['host']};dbname={$args['database']};charset={$args['charset']}";
|
$dsn = "mysql:host={$args['host']};dbname={$args['database']};charset={$args['charset']}";
|
||||||
$options = [
|
$options = [
|
||||||
PDO::ATTR_PERSISTENT => true,
|
PDO::ATTR_PERSISTENT => true,
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
|
||||||
];
|
];
|
||||||
return new PDO($dsn, $args['user'], $args['password'], $options);
|
return new PDO($dsn, $args['user'], $args['password'], $options);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user