How can I gracefully escape an error condition?

This line is wrong:

$xPath = new DOMXPath(@$dom);

Should be this:

$xPath = new DOMXPath($dom);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)