MDL-64060 message: Replace error code by language str
authorDavid Monllao <davidm@moodle.com>
Mon, 19 Nov 2018 10:18:39 +0000 (11:18 +0100)
committerDavid Monllao <davidm@moodle.com>
Mon, 19 Nov 2018 10:18:39 +0000 (11:18 +0100)
lang/en/message.php
message/externallib.php

index af530f7..ce9ad84 100644 (file)
@@ -61,6 +61,7 @@ $string['editmessages'] = 'Edit messages';
 $string['emailtagline'] = 'This is a copy of a message sent to you at "{$a->sitename}". Go to {$a->url} to reply.';
 $string['enabled'] = 'Enabled';
 $string['errorcallingprocessor'] = 'Error calling defined output';
+$string['errorconversationdoesnotexist'] = 'Conversation does not exist';
 $string['errortranslatingdefault'] = 'Error translating default setting provided by plugin, using system defaults instead.';
 $string['eventgroupmessagesent'] = 'Group message sent';
 $string['eventnotificationviewed'] = 'Notification viewed';
index a9ff688..f842b85 100644 (file)
@@ -1708,7 +1708,7 @@ class core_message_external extends external_api {
         } else {
             // We have to throw an exception here because the external functions annoyingly
             // don't accept null to be returned for a single structure.
-            throw new \moodle_exception('conversationdoesntexist');
+            throw new \moodle_exception('errorconversationdoesnotexist', 'message');
         }
     }
 
@@ -1813,7 +1813,7 @@ class core_message_external extends external_api {
         } else {
             // We have to throw an exception here because the external functions annoyingly
             // don't accept null to be returned for a single structure.
-            throw new \moodle_exception('conversationdoesntexist');
+            throw new \moodle_exception('errorconversationdoesnotexist', 'message');
         }
     }