trace contains the login data and we don't want to log/show that information. Generate a new exception which strips off the stack trace, as the stack Set HTTP response to 503: Service Unavailable $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION) Įrror_log('Failure while creating PDO context:'. $pdo = new \PDO($db_dsn, $db_login, $db_pass) $db_dsn = 'sqlsrv:Server='.$db_host.' Database='.$db_name