PHP Class SimpleSAML_Error_Error, simplesamlphp

Author: Olav Morken, UNINETT AS.
Inheritance: extends SimpleSAML_Error_Exception
Show file Open project: simplesamlphp/simplesamlphp Class Usage Examples

Protected Properties

Property Type Description
$httpCode integer The http code.
$includeTemplate string | null Name of custom include template for the error.

Public Methods

Method Description
__construct ( mixed $errorCode, Exception $cause = null, integer | null $httpCode = null ) Constructor for this error.
getDictDescr ( ) : string Retrieve the error description tag in dictionary.
getDictTitle ( ) : string Retrieve the error title tag in dictionary.
getErrorCode ( ) : string Retrieve the error code given when throwing this error.
getParameters ( ) : array Retrieve the error parameters given when throwing this error.
show ( ) Display this error.

Protected Methods

Method Description
saveError ( ) : array Save an error report.
setHTTPCode ( ) Set the HTTP return code for this error.

Method Details

__construct() public method

The error can either be given as a string, or as an array. If it is an array, the first element in the array (with index 0), is the error code, while the other elements are replacements for the error text.
public __construct ( mixed $errorCode, Exception $cause = null, integer | null $httpCode = null )
$errorCode mixed One of the error codes defined in the errors dictionary.
$cause Exception The exception which caused this fatal error (if any). Optional.
$httpCode integer | null The HTTP response code to use. Optional.

getDictDescr() public method

Retrieve the error description tag in dictionary.
public getDictDescr ( ) : string
return string The error description tag.

getDictTitle() public method

Retrieve the error title tag in dictionary.
public getDictTitle ( ) : string
return string The error title tag.

getErrorCode() public method

Retrieve the error code given when throwing this error.
public getErrorCode ( ) : string
return string The error code.

getParameters() public method

Retrieve the error parameters given when throwing this error.
public getParameters ( ) : array
return array The parameters.

saveError() protected method

Save an error report.
protected saveError ( ) : array
return array The array with the error report data.

setHTTPCode() protected method

This should be overridden by subclasses who want a different return code than 500 Internal Server Error.
protected setHTTPCode ( )

show() public method

This method displays a standard SimpleSAMLphp error page and exits.
public show ( )

Property Details

$httpCode protected property

The http code.
protected int $httpCode
return integer

$includeTemplate protected property

Name of custom include template for the error.
protected string|null $includeTemplate
return string | null