LastError
extends HordeException
in package
Horde exception class that accepts output of error_get_last() as $code and mask itself as that error.
This class is strictly for straight conversion of legacy code, maintaining a similar type hierarchy as the unnamespaced exceptions.
An alternative implementation using a more well-defined static method should NOT use a custom constructor.
Tags
Table of Contents
- $details : string
- Error details that should not be part of the main exception message, e.g. any additional debugging information.
- $logged : bool
- Has this exception been logged?
- $_logLevel : int
- The log level to use. A Horde_Log constant.
- $extraDetails : string
- $isLogged : bool
- __construct() : mixed
- Exception constructor
- getDetails() : string
- Get additional details separated from the exception's message
- getLogLevel() : int
- Get the log level.
- isLogged() : bool
- Check if this exception has been logged.
- markAsLogged() : void
- Mark this exception as already logged. This cannot be undone.
- setDetails() : void
- Set additional details separated from the exception's message
- setLogLevel() : void
- Sets the log level.
Properties
$details
Error details that should not be part of the main exception message, e.g. any additional debugging information.
public
string
$details
Tags
$logged
Has this exception been logged?
public
bool
$logged
= false
Tags
$_logLevel
The log level to use. A Horde_Log constant.
protected
int
$_logLevel
= 0
Name and protected status for legacy reasons. Should rather be private.
$extraDetails
protected
string
$extraDetails
= ''
$isLogged
private
bool
$isLogged
= false
Methods
__construct()
Exception constructor
public
__construct([string|Exception|null $message = null ][, mixed $code_or_lasterror = null ]) : mixed
If $lasterror is passed the return value of error_get_last() (or a matching format), the exception will be rewritten to have its file and line parameters match that of the array, and any message in the array will be appended to $message.
Parameters
- $message : string|Exception|null = null
-
The exception message, a PEAR_Error object, or an Exception object.
- $code_or_lasterror : mixed = null
Return values
mixed —getDetails()
Get additional details separated from the exception's message
public
getDetails() : string
Return values
string —getLogLevel()
Get the log level.
public
final getLogLevel() : int
Return values
int —The Horde_Log constant for the log level.
isLogged()
Check if this exception has been logged.
public
final isLogged() : bool
Return values
bool —markAsLogged()
Mark this exception as already logged. This cannot be undone.
public
final markAsLogged() : void
Return values
void —setDetails()
Set additional details separated from the exception's message
public
setDetails(string $details) : void
Parameters
- $details : string
Return values
void —setLogLevel()
Sets the log level.
public
final setLogLevel(int|string $level) : void
Parameters
- $level : int|string
-
The log level.