I've noticed that setting fCore::enableErrorHandling() and fCore::enableExceptionHandling() without 'html' as the value still prints the message on screen. In my scenario I do the following:
$template = new fTemplating(DOC_ROOT . '/templates/');
$template->set('site_down', 'site_down.php');
fCore::enableErrorHandling(DOC_ROOT . '/writable/errors.log');
fCore::enableExceptionHandling(DOC_ROOT . '/writable/exceptions.log', array($template, 'place'), array('site_down'));
$db = new fDatabase('mysql', 'invalid_db', 'invalid_user', 'invalid_pass', 'invalid_host');
if($db->getConnection()) {
echo "connected!";
} else {
echo "cannot connect!";
}
fORMDatabase::attach($db);
I purposely used invalid database connection information. I expected the connection to fail and for the "site_down.php" template to load with all errors and exceptions being written to .log files. Instead the "It appears an error has occured - we apologize for the inconvenience. The problem may be resolved if you try again." message was printed on screen.
I was able to track down the error and believe that it is in fCore::handleException() line# 824:
if (self::$exception_destination != 'html' && $exception instanceof fException) {
I believe that should be changed to:
if (self::$exception_destination == 'html' && $exception instanceof fException) {