Skip to content

Commit

Permalink
NOMDL Fixed incorrect throwing of exceptions - missing 'new' or unkno…
Browse files Browse the repository at this point in the history
…wn exception class
  • Loading branch information
mudrd8mz committed Jul 18, 2010
1 parent b8bb45b commit 2d3522a
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions backup/moodle2/backup_activity_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ public function __construct($name, $moduleid, $plan = null) {

// 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;
Expand Down
2 changes: 1 addition & 1 deletion backup/moodle2/backup_block_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct($name, $blockid, $moduleid = null, $plan = null) {

// 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;
Expand Down
2 changes: 1 addition & 1 deletion backup/moodle2/backup_section_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct($name, $sectionid, $plan = null) {

// 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;
Expand Down
2 changes: 1 addition & 1 deletion backup/util/loggers/simpletest/testlogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function test_file_logger() {
@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
Expand Down
2 changes: 1 addition & 1 deletion backup/util/plan/simpletest/teststep.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function test_backup_structure_step() {
@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
Expand Down
2 changes: 1 addition & 1 deletion backup/util/xml/output/simpletest/testoutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ function test_file_xml_output() {
@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
Expand Down
2 changes: 1 addition & 1 deletion enrol/manual/manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
}

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);
Expand Down
2 changes: 1 addition & 1 deletion mod/workshop/form/accumulative/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public function save_assessment(stdclass $assessment, stdclass $data) {
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();
Expand Down
2 changes: 1 addition & 1 deletion mod/workshop/form/comments/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public function save_assessment(stdclass $assessment, stdclass $data) {
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();
Expand Down
2 changes: 1 addition & 1 deletion mod/workshop/form/numerrors/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public function save_assessment(stdclass $assessment, stdclass $data) {
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();
Expand Down

0 comments on commit 2d3522a

Please sign in to comment.