Skip to content

Commit

Permalink
MDL-48008 gradeimport_xml: report errors usefully
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Oct 31, 2014
1 parent 7deea8e commit 9139195
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions grade/import/xml/import.php
Expand Up @@ -48,7 +48,8 @@

$text = download_file_content($url);
if ($text === false) {
print_error('cannotreadfile');
print_error('cannotreadfile', 'error',
$CFG->wwwroot . '/grade/import/xml/index.php?id=' . $id, $url);
}

$error = '';
Expand All @@ -75,7 +76,6 @@
}

} else {
print_error('error', 'gradeimport_xml');
print_error('errorduringimport', 'gradeimport_xml',
$CFG->wwwroot . '/grade/import/xml/index.php?id=' . $id, $error);
}


1 change: 1 addition & 0 deletions grade/import/xml/lang/en/gradeimport_xml.php
Expand Up @@ -30,6 +30,7 @@
$string['errincorrectidnumber'] = 'Error - incorrect idnumber';
$string['errincorrectuseridnumber'] = 'Error - idnumber \'{$a}\' from the import file does not match any user.';
$string['error'] = 'Errors occur';
$string['errorduringimport'] = 'An error occurred when trying to import: {$a}';
$string['fileurl'] = 'Remote file URL';
$string['pluginname'] = 'XML file';
$string['xml:publish'] = 'Publish import grades from XML';
Expand Down

0 comments on commit 9139195

Please sign in to comment.