Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Protected Attributes | List of all members
mod_lti\service_exception_handler Class Reference

Handles exceptions when handling incoming LTI messages. More...

Public Member Functions

 __construct ($log)
 Constructor. More...
 
 handle ($exception)
 Echo an exception message encapsulated in XML. More...
 
 set_message_id ($id)
 Set the LTI message ID being handled. More...
 
 set_message_type ($type)
 Set the LTI message type being handled. More...
 

Protected Attributes

string $id = ''
 The LTI service message ID, if known.
 
bool $log = false
 Enable error response logging.
 
string $type = 'unknownRequest'
 The LTI service message type, if known.
 

Detailed Description

Handles exceptions when handling incoming LTI messages.

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

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

mod_lti\service_exception_handler::__construct (   $log)

Constructor.

Parameters
boolean$logEnable error response logging.

Member Function Documentation

◆ handle()

mod_lti\service_exception_handler::handle (   $exception)

Echo an exception message encapsulated in XML.

Parameters
Exception | Throwable$exceptionThe exception that was thrown

◆ set_message_id()

mod_lti\service_exception_handler::set_message_id (   $id)

Set the LTI message ID being handled.

Parameters
string$id

◆ set_message_type()

mod_lti\service_exception_handler::set_message_type (   $type)

Set the LTI message type being handled.

Parameters
string$type

The documentation for this class was generated from the following file: