function default_exception_handler($ex) {
global $DB, $OUTPUT;
- if ($DB) {
- // If you enable db debugging and exception is thrown, the print footer prints a lot of rubbish
- $DB->set_debug(0);
- }
-
// detect active db transactions, rollback and log as error
abort_all_db_transactions();
echo bootstrap_renderer::early_error($info->message, $info->moreinfourl, $info->link, $info->backtrace, $info->debuginfo);
} else {
try {
+ if ($DB) {
+ // If you enable db debugging and exception is thrown, the print footer prints a lot of rubbish
+ $DB->set_debug(0);
+ }
echo $OUTPUT->fatal_error($info->message, $info->moreinfourl, $info->link, $info->backtrace, $info->debuginfo);
} catch (Exception $out_ex) {
// default exception handler MUST not throw any exceptions!!
* upgrade logging functions
*/
function upgrade_handle_exception($ex, $plugin = null) {
+ // rollback everything, we need to log all upgrade problems
+ abort_all_db_transactions();
+
$info = get_exception_info($ex);
// First log upgrade error
print_upgrade_part_end(null, true, $verbose);
} catch (exception $ex) {
- //TODO: unconditionally rollback DB transaction if active
upgrade_handle_exception($ex);
}
}
print_upgrade_part_end('moodle', false, $verbose);
} catch (Exception $ex) {
- //TODO: unconditionally rollback DB transaction if active
upgrade_handle_exception($ex);
}
}