From 8fb18ca939aadfc4800471c8f3e73145e432530c Mon Sep 17 00:00:00 2001 From: Penny Leach Date: Tue, 23 Feb 2010 10:09:32 +0000 Subject: [PATCH] mnet MDL-21692 print an error when we can't contact the host when adding a new peer --- lang/en_utf8/mnet.php | 1 + mnet/peer.php | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) 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;