Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'MDL-33364_21' of git://github.com/stronk7/moodle into M…

…OODLE_21_STABLE
  • Loading branch information...
commit 27ee2b673775dc736f87c2974b2d286a0e726c76 2 parents f991601 + f3593fc
Sam Hemelryk samhemelryk authored

Showing 1 changed file with 7 additions and 5 deletions. Show diff stats Hide diff stats

  1. +7 5 backup/util/helper/backup_cron_helper.class.php
12 backup/util/helper/backup_cron_helper.class.php
@@ -315,6 +315,7 @@ public static function calculate_next_automated_backup($timezone, $now) {
315 315 */
316 316 public static function launch_automated_backup($course, $starttime, $userid) {
317 317
  318 + $outcome = true;
318 319 $config = get_config('backup');
319 320 $bc = new backup_controller(backup::TYPE_1COURSE, $course->id, backup::FORMAT_MOODLE, backup::INTERACTIVE_NO, backup::MODE_AUTOMATED, $userid);
320 321
@@ -347,7 +348,7 @@ public static function launch_automated_backup($course, $starttime, $userid) {
347 348
348 349 $bc->set_status(backup::STATUS_AWAITING);
349 350
350   - $outcome = $bc->execute_plan();
  351 + $bc->execute_plan();
351 352 $results = $bc->get_results();
352 353 $file = $results['backup_destination'];
353 354 $dir = $config->backup_auto_destination;
@@ -363,16 +364,17 @@ public static function launch_automated_backup($course, $starttime, $userid) {
363 364 }
364 365 }
365 366
366   - $outcome = true;
367   - } catch (backup_exception $e) {
368   - $bc->log('backup_auto_failed_on_course', backup::LOG_WARNING, $course->shortname);
  367 + } catch (moodle_exception $e) {
  368 + $bc->log('backup_auto_failed_on_course', backup::LOG_ERROR, $course->shortname); // Log error header.
  369 + $bc->log('Exception: ' . $e->errorcode, backup::LOG_ERROR, $e->a, 1); // Log original exception problem.
  370 + $bc->log('Debug: ' . $e->debuginfo, backup::LOG_DEBUG, null, 1); // Log original debug information.
369 371 $outcome = false;
370 372 }
371 373
372 374 $bc->destroy();
373 375 unset($bc);
374 376
375   - return true;
  377 + return $outcome;
376 378 }
377 379
378 380 /**

0 comments on commit 27ee2b6

Please sign in to comment.
Something went wrong with that request. Please try again.