Setting PDO::ATTR_ERRMODE to E_WARNING before connecting!

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

$dbh = new PDO('mysql:host='.$HOST.';dbname='.$NAME, $USER, $PASS,

The above is supposed to set PDO to E_WARNING instead of PDO exception.
Yet it throws exception.

I know it is possible to do:


but this works only if connection has been established in the first place.
What if there is a connection error - then you are forced to handle
exceptions with try/catch block...

The same applies to PDO::ERRMODE_SILENT

Any solutions to setting error mode before connecting or is this a stupid

Site Timeline