From 726fb801b93d784c01439b28f556b95ae3027b6a Mon Sep 17 00:00:00 2001
From: Astor Bizard <astor.bizard@grenoble-inp.fr>
Date: Mon, 20 Jan 2020 11:23:44 +0100
Subject: [PATCH] Changed password exception for webservices to include an
 errorcode

---
 externallib.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/externallib.php b/externallib.php
index f795b324..8de05c02 100644
--- a/externallib.php
+++ b/externallib.php
@@ -35,7 +35,7 @@ class mod_vpl_webservice extends external_api {
             throw new Exception( get_string( 'opnotallowfromclient', VPL ) . ' ' . getremoteaddr() );
         }
         if (! $vpl->pass_password_check( $password )) {
-            throw new Exception( get_string( 'requiredpassword', VPL ) );
+            throw new moodle_exception('requiredpassword', VPL);
         }
         return $vpl;
     }
-- 
GitLab