NOMDL Fixed incorrect throwing of exceptions - missing 'new' or unknown exception class

This commit is contained in:
David Mudrak
2010-07-18 12:30:49 +00:00
parent b8bb45b001
commit 2d3522ae1e
10 changed files with 11 additions and 11 deletions
@@ -43,11 +43,11 @@ abstract class backup_activity_task extends backup_task {
// Check moduleid exists
if (!$coursemodule = get_coursemodule_from_id(false, $moduleid)) {
throw backup_task_exception('activity_task_coursemodule_not_found', $moduleid);
throw new backup_task_exception('activity_task_coursemodule_not_found', $moduleid);
}
// Check activity supports this moodle2 backup format
if (!plugin_supports('mod', $coursemodule->modname, FEATURE_BACKUP_MOODLE2)) {
throw backup_task_exception('activity_task_activity_lacks_moodle2_backup_support', $coursemodule->modname);
throw new backup_task_exception('activity_task_activity_lacks_moodle2_backup_support', $coursemodule->modname);
}
$this->moduleid = $moduleid;
+1 -1
View File
@@ -45,7 +45,7 @@ abstract class backup_block_task extends backup_task {
// Check blockid exists
if (!$block = $DB->get_record('block_instances', array('id' => $blockid))) {
throw backup_task_exception('block_task_block_instance_not_found', $blockid);
throw new backup_task_exception('block_task_block_instance_not_found', $blockid);
}
$this->blockid = $blockid;
+1 -1
View File
@@ -40,7 +40,7 @@ class backup_section_task extends backup_task {
// Check section exists
if (!$section = $DB->get_record('course_sections', array('id' => $sectionid))) {
throw backup_task_exception('section_task_section_not_found', $sectionid);
throw new backup_task_exception('section_task_section_not_found', $sectionid);
}
$this->sectionid = $sectionid;
@@ -235,7 +235,7 @@ class logger_test extends UnitTestCase {
@remove_dir(dirname($file));
// Recreate test dir
if (!check_dir_exists(dirname($file), true, true)) {
throw moodle_exception('error_creating_temp_dir', 'error', dirname($file));
throw new moodle_exception('error_creating_temp_dir', 'error', dirname($file));
}
// Instantiate with date and level output, and also use the depth option
+1 -1
View File
@@ -200,7 +200,7 @@ class backup_step_test extends UnitTestCase {
@remove_dir(dirname($file));
// Recreate test dir
if (!check_dir_exists(dirname($file), true, true)) {
throw moodle_exception('error_creating_temp_dir', 'error', dirname($file));
throw new moodle_exception('error_creating_temp_dir', 'error', dirname($file));
}
// We need one (non interactive) controller for instatiating plan
@@ -224,7 +224,7 @@ class xml_output_test extends UnitTestCase {
@remove_dir(dirname($file));
// Recreate test dir
if (!check_dir_exists(dirname($file), true, true)) {
throw moodle_exception('error_creating_temp_dir', 'error', dirname($file));
throw new moodle_exception('error_creating_temp_dir', 'error', dirname($file));
}
// Instantiate xml_output
+1 -1
View File
@@ -52,7 +52,7 @@ if (!isset($roles[$roleid])) {
}
if (!$enrol_manual = enrol_get_plugin('manual')) {
throw coding_error('Can not instantiate enrol_manual');
throw new coding_exception('Can not instantiate enrol_manual');
}
$instancename = $enrol_manual->get_instance_name($instance);
+1 -1
View File
@@ -245,7 +245,7 @@ class workshop_accumulative_strategy implements workshop_strategy {
global $DB;
if (!isset($data->nodims)) {
throw coding_expection('You did not send me the number of assessment dimensions to process');
throw new coding_expection('You did not send me the number of assessment dimensions to process');
}
for ($i = 0; $i < $data->nodims; $i++) {
$grade = new stdclass();
+1 -1
View File
@@ -244,7 +244,7 @@ class workshop_comments_strategy implements workshop_strategy {
global $DB;
if (!isset($data->nodims)) {
throw coding_expection('You did not send me the number of assessment dimensions to process');
throw new coding_expection('You did not send me the number of assessment dimensions to process');
}
for ($i = 0; $i < $data->nodims; $i++) {
$grade = new stdclass();
+1 -1
View File
@@ -280,7 +280,7 @@ class workshop_numerrors_strategy implements workshop_strategy {
global $DB;
if (!isset($data->nodims)) {
throw coding_expection('You did not send me the number of assessment dimensions to process');
throw new coding_expection('You did not send me the number of assessment dimensions to process');
}
for ($i = 0; $i < $data->nodims; $i++) {
$grade = new stdclass();