Considering the following code, run by cron:
try {
$count = $stmt->execute ( $queryArray );
}
catch ( PDOException $ex ) {
fwrite ( $fp, ' "exception" at line: ' . (__LINE__ - 3). ", " . $ex -> getMessage () . "
" );
throw new RuntimeException (
basename (__FILE__) . '::' . __METHOD__ . ' - Execute query failed: ' . $ex -> getMessage () );
}
Is re-throwing by throw new RuntimeException
causing the program to stop? In other words, would the catch
& fwrite
statement sufficiently 'catch' the exception and allow the program to continue?
The throw
documentation is vague. The only reference is to PHP Fatal Error
from (link to) PHP Exceptions:
When an exception is thrown, code following the statement will not be executed, and PHP will attempt to find the first matching catch block. If an exception is not caught, a PHP Fatal Error will be issued with an "Uncaught Exception ..." message, unless a handler has been defined with set_exception_handler().