mnet MDL-21692 print an error when we can't contact the host when adding a new peer

This commit is contained in:
Penny Leach
2010-02-23 10:09:32 +00:00
parent 8810fb89b1
commit 8fb18ca939
2 changed files with 2 additions and 2 deletions
+1
View File
@@ -301,4 +301,5 @@ $string['importfields'] = 'Fields to import';
$string['exportfields'] = 'Fields to export';
$string['defaultfields'] = 'The globally set fields, which you are about to override, are: ';
$string['leavedefault'] = 'Use the default settings instead';
$string['noaddressforhost'] = 'Sorry, but that hostname ($a) could not be resolved!';
?>
+1 -2
View File
@@ -58,8 +58,7 @@ class mnet_peer {
// Couldn't find the IP address?
if ($ip_address === $hostname && !preg_match('/^\d+\.\d+\.\d+.\d+$/',$hostname)) {
$this->error[] = array('code' => 2, 'text' => get_string("noaddressforhost", 'mnet'));
return false;
throw new moodle_exception('noaddressforhost', 'mnet', '', $hostname);
}
$this->name = $wwwroot;