diff --git a/lang/en_utf8/mnet.php b/lang/en_utf8/mnet.php index 50c5e920f93..be81426c911 100644 --- a/lang/en_utf8/mnet.php +++ b/lang/en_utf8/mnet.php @@ -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!'; ?> diff --git a/mnet/peer.php b/mnet/peer.php index 75f5fef546c..6f82b293d6e 100644 --- a/mnet/peer.php +++ b/mnet/peer.php @@ -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;