PHP Класс SimpleSAML_Error_Exception, simplesamlphp

This class tries to make sure that every exception is serializable.
Автор: Thomas Graff ([email protected])
Наследование: extends Exception
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string $message, integer $code, Exception $cause = null ) Constructor for this error.
__sleep ( ) : array Function for serialization.
format ( boolean $anonymize = false ) : array Format this exception for logging.
formatBacktrace ( boolean $anonymize = false ) : array Format the backtrace for logging.
fromException ( Exception $e ) : SimpleSAML_Error_Exception Convert any exception into a SimpleSAML_Error_Exception.
getBacktrace ( ) : array Retrieve the backtrace.
getCause ( ) : SimpleSAML_Error_Exception | null Retrieve the cause of this exception.
getClass ( ) : string Retrieve the class of this exception.
log ( integer $default_level ) Print the exception to the log, by default with log level error.
logDebug ( ) Print the exception to the log with log level debug.
logError ( ) Print the exception to the log with log level error.
logInfo ( ) Print the exception to the log with log level info.
logWarning ( ) Print the exception to the log with log level warning.

Защищенные методы

Метод Описание
initBacktrace ( Exception $exception ) Load the backtrace from the given exception.
logBacktrace ( $level = SimpleSAML\Logger::DEBUG ) Print the backtrace to the log if the 'debug' option is enabled in the configuration.

Описание методов

__construct() публичный Метод

Note that the cause will be converted to a SimpleSAML_Error_UnserializableException unless it is a subclass of SimpleSAML_Error_Exception.
public __construct ( string $message, integer $code, Exception $cause = null )
$message string Exception message
$code integer Error code
$cause Exception The cause of this exception.

__sleep() публичный Метод

This function builds a list of all variables which should be serialized. It will serialize all variables except the Exception::trace variable.
public __sleep ( ) : array
Результат array Array with the variables that should be serialized.

format() публичный Метод

Create an array of lines for logging.
public format ( boolean $anonymize = false ) : array
$anonymize boolean Whether the resulting messages should be anonymized or not.
Результат array Log lines that should be written out.

formatBacktrace() публичный Метод

Create an array of lines for logging from the backtrace.
public formatBacktrace ( boolean $anonymize = false ) : array
$anonymize boolean Whether the resulting messages should be anonymized or not.
Результат array All lines of the backtrace, properly formatted.

fromException() публичный статический Метод

Convert any exception into a SimpleSAML_Error_Exception.
public static fromException ( Exception $e ) : SimpleSAML_Error_Exception
$e Exception The exception.
Результат SimpleSAML_Error_Exception The new exception.

getBacktrace() публичный Метод

Retrieve the backtrace.
public getBacktrace ( ) : array
Результат array An array where each function call is a single item.

getCause() публичный Метод

Retrieve the cause of this exception.
public getCause ( ) : SimpleSAML_Error_Exception | null
Результат SimpleSAML_Error_Exception | null The cause of this exception.

getClass() публичный Метод

Retrieve the class of this exception.
public getClass ( ) : string
Результат string The name of the class.

initBacktrace() защищенный Метод

Load the backtrace from the given exception.
protected initBacktrace ( Exception $exception )
$exception Exception The exception we should fetch the backtrace from.

log() публичный Метод

Override to allow errors extending this class to specify the log level themselves.
public log ( integer $default_level )
$default_level integer The log level to use if this method was not overridden.

logBacktrace() защищенный Метод

Print the backtrace to the log if the 'debug' option is enabled in the configuration.
protected logBacktrace ( $level = SimpleSAML\Logger::DEBUG )

logDebug() публичный Метод

This function will write this exception to the log, including a full backtrace.
public logDebug ( )

logError() публичный Метод

This function will write this exception to the log, including a full backtrace.
public logError ( )

logInfo() публичный Метод

This function will write this exception to the log, including a full backtrace.
public logInfo ( )

logWarning() публичный Метод

This function will write this exception to the log, including a full backtrace.
public logWarning ( )