Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Exception handler for LTI services

Copyright: Copyright (c) 2015 Moodlerooms Inc. (http://www.moodlerooms.com)
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 122 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 2 files
 mod/lti/servicelib.php
 mod/lti/locallib.php

Defines 1 class

service_exception_handler:: (4 methods):
  __construct()
  set_message_id()
  set_message_type()
  handle()


Class: service_exception_handler  - X-Ref

Handles exceptions when handling incoming LTI messages.

Ensures that LTI always returns a XML message that can be consumed by the caller.

__construct($log)   X-Ref
Constructor.

param: boolean $log Enable error response logging.

set_message_id($id)   X-Ref
Set the LTI message ID being handled.

param: string $id

set_message_type($type)   X-Ref
Set the LTI message type being handled.

param: string $type

handle($exception)   X-Ref
Echo an exception message encapsulated in XML.

param: \Exception|\Throwable $exception The exception that was thrown