ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilSoapExceptionHandler Class Reference
+ Inheritance diagram for ilSoapExceptionHandler:
+ Collaboration diagram for ilSoapExceptionHandler:

Public Member Functions

 handle ()
 

Private Member Functions

 buildFaultString ()
 
 getSimpleExceptionOutput (Throwable $exception)
 
 toXml ()
 

Detailed Description

Definition at line 21 of file class.ilSoapExceptionHandler.php.

Member Function Documentation

◆ buildFaultString()

ilSoapExceptionHandler::buildFaultString ( )
private

Definition at line 23 of file class.ilSoapExceptionHandler.php.

23 : string
24 {
25 if (!defined('DEVMODE') || DEVMODE !== 1) {
26 return htmlspecialchars($this->getInspector()->getException()->getMessage());
27 }
28
29 $fault_string = \Whoops\Exception\Formatter::formatExceptionPlain($this->getInspector());
30 $exception = $this->getInspector()->getException();
31 $previous = $exception->getPrevious();
32 while ($previous) {
33 $fault_string .= "\n\nCaused by\n" . $this->getSimpleExceptionOutput($previous);
34 $previous = $previous->getPrevious();
35 }
36
37 return htmlspecialchars($fault_string);
38 }
getSimpleExceptionOutput(Throwable $exception)

References getSimpleExceptionOutput().

Referenced by toXml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSimpleExceptionOutput()

ilSoapExceptionHandler::getSimpleExceptionOutput ( Throwable  $exception)
private

Definition at line 40 of file class.ilSoapExceptionHandler.php.

40 : string
41 {
42 return sprintf(
43 '%s: %s in file %s on line %d',
44 get_class($exception),
45 $exception->getMessage(),
46 $exception->getFile(),
47 $exception->getLine()
48 );
49 }

Referenced by buildFaultString().

+ Here is the caller graph for this function:

◆ handle()

ilSoapExceptionHandler::handle ( )

Definition at line 51 of file class.ilSoapExceptionHandler.php.

51 : ?int
52 {
53 echo $this->toXml();
54
55 return \Whoops\Handler\Handler::QUIT;
56 }

References toXml().

+ Here is the call graph for this function:

◆ toXml()

ilSoapExceptionHandler::toXml ( )
private

Definition at line 58 of file class.ilSoapExceptionHandler.php.

58 : string
59 {
60 $fault_code = htmlspecialchars((string) $this->getInspector()->getException()->getCode());
61 $fault_string = $this->buildFaultString();
62
63 $xml = '<?xml version="1.0" encoding="UTF-8"?>';
64 $xml .= '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">';
65 $xml .= ' <SOAP-ENV:Body>';
66 $xml .= ' <SOAP-ENV:Fault>';
67 $xml .= ' <faultcode>' . $fault_code . '</faultcode>';
68 $xml .= ' <faultstring>' . $fault_string . '</faultstring>';
69 $xml .= ' </SOAP-ENV:Fault>';
70 $xml .= ' </SOAP-ENV:Body>';
71 $xml .= '</SOAP-ENV:Envelope>';
72
73 return $xml;
74 }

References buildFaultString().

Referenced by handle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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