ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SimpleSAML_Error_NotFound Class Reference
+ Inheritance diagram for SimpleSAML_Error_NotFound:
+ Collaboration diagram for SimpleSAML_Error_NotFound:

Public Member Functions

 __construct ($reason=null)
 Create a new NotFound error. More...
 
 getReason ()
 Retrieve the reason why the given page could not be found. More...
 
 format ($anonymize=false)
 NotFound exceptions don't need to display a backtrace, as they are very simple and the trace is usually trivial, so just log the message without any backtrace at all. More...
 
- Public Member Functions inherited from SimpleSAML_Error_Error
 __construct ($errorCode, Exception $cause=null, $httpCode=null)
 Constructor for this error. More...
 
 getErrorCode ()
 Retrieve the error code given when throwing this error. More...
 
 getParameters ()
 Retrieve the error parameters given when throwing this error. More...
 
 getDictTitle ()
 Retrieve the error title tag in dictionary. More...
 
 getDictDescr ()
 Retrieve the error description tag in dictionary. More...
 
 show ()
 Display this error. More...
 
- Public Member Functions inherited from SimpleSAML_Error_Exception
 __construct ($message, $code=0, Exception $cause=null)
 Constructor for this error. More...
 
 getBacktrace ()
 Retrieve the backtrace. More...
 
 getCause ()
 Retrieve the cause of this exception. More...
 
 getClass ()
 Retrieve the class of this exception. More...
 
 format ($anonymize=false)
 Format this exception for logging. More...
 
 formatBacktrace ($anonymize=false)
 Format the backtrace for logging. More...
 
 log ($default_level)
 Print the exception to the log, by default with log level error. More...
 
 logError ()
 Print the exception to the log with log level error. More...
 
 logWarning ()
 Print the exception to the log with log level warning. More...
 
 logInfo ()
 Print the exception to the log with log level info. More...
 
 logDebug ()
 Print the exception to the log with log level debug. More...
 
 __sleep ()
 Function for serialization. More...
 

Private Attributes

 $reason
 Reason why the given page could not be found. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from SimpleSAML_Error_Exception
static fromException (Exception $e)
 Convert any exception into a SimpleSAML_Error_Exception. More...
 
- Protected Member Functions inherited from SimpleSAML_Error_Error
 setHTTPCode ()
 Set the HTTP return code for this error. More...
 
 saveError ()
 Save an error report. More...
 
- Protected Member Functions inherited from SimpleSAML_Error_Exception
 initBacktrace (Exception $exception)
 Load the backtrace from the given exception. More...
 
 logBacktrace ($level=\SimpleSAML\Logger::DEBUG)
 Print the backtrace to the log if the 'debug' option is enabled in the configuration. More...
 
- Protected Attributes inherited from SimpleSAML_Error_Error
 $httpCode = 500
 
 $includeTemplate = null
 

Detailed Description

Definition at line 12 of file NotFound.php.

Constructor & Destructor Documentation

◆ __construct()

SimpleSAML_Error_NotFound::__construct (   $reason = null)

Create a new NotFound error.

Parameters
string$reasonOptional description of why the given page could not be found.

Definition at line 27 of file NotFound.php.

References $reason, and $url.

28  {
29 
30  assert($reason === null || is_string($reason));
31 
32  $url = \SimpleSAML\Utils\HTTP::getSelfURL();
33 
34  if ($reason === null) {
35  parent::__construct(array('NOTFOUND', '%URL%' => $url));
36  $this->message = "The requested page '$url' could not be found.";
37  } else {
38  parent::__construct(array('NOTFOUNDREASON', '%URL%' => $url, '%REASON%' => $reason));
39  $this->message = "The requested page '$url' could not be found. ".$reason;
40  }
41 
42  $this->reason = $reason;
43  $this->httpCode = 404;
44  }
$reason
Reason why the given page could not be found.
Definition: NotFound.php:19
$url

Member Function Documentation

◆ format()

SimpleSAML_Error_NotFound::format (   $anonymize = false)

NotFound exceptions don't need to display a backtrace, as they are very simple and the trace is usually trivial, so just log the message without any backtrace at all.

Parameters
bool$anonymizeWhether to anonymize the trace or not.
Returns
array

Definition at line 66 of file NotFound.php.

References SimpleSAML_Error_Exception\getClass().

67  {
68  return array(
69  $this->getClass().': '.$this->getMessage(),
70  );
71  }
getClass()
Retrieve the class of this exception.
Definition: Exception.php:135
+ Here is the call graph for this function:

◆ getReason()

SimpleSAML_Error_NotFound::getReason ( )

Retrieve the reason why the given page could not be found.

Returns
string|null The reason why the page could not be found.

Definition at line 52 of file NotFound.php.

References $reason.

53  {
54  return $this->reason;
55  }
$reason
Reason why the given page could not be found.
Definition: NotFound.php:19

Field Documentation

◆ $reason

SimpleSAML_Error_NotFound::$reason
private

Reason why the given page could not be found.

Definition at line 19 of file NotFound.php.

Referenced by __construct(), and getReason().


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