Skip to content

Commit

Permalink
[#22] Improve 4.x support
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhilton authored and golenkovm committed May 3, 2024
1 parent 7c5c355 commit ed90824
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

use core_external\external_api;
use core_external\external_settings;

defined('MOODLE_INTERNAL') || die();

require_once("$CFG->dirroot/webservice/lib.php");
Expand Down Expand Up @@ -310,7 +313,6 @@ public function run() {
)
);
$event = \core\event\webservice_function_called::create($params);
$event->set_legacy_logdata(array(SITEID, 'webservice', $this->functionname, '' , getremoteaddr() , 0, $this->userid));
$event->trigger();

// Do additional setup stuff.
Expand Down Expand Up @@ -409,7 +411,9 @@ protected function generate_error($ex) {
if ($this->responseformat != 'xml') {
$errorobject = new stdClass;
$errorobject->exception = get_class($ex);
$errorobject->errorcode = $ex->errorcode;
if (isset($ex->errorcode)) {
$errorobject->errorcode = $ex->errorcode;
}
$errorobject->message = $ex->getMessage();
if (debugging() and isset($ex->debuginfo)) {
$errorobject->debuginfo = $ex->debuginfo;
Expand Down

0 comments on commit ed90824

Please sign in to comment.