public static
boolean
|
#
isError( mixed $object )
Method to determine if a value is an exception object.
Method to determine if a value is an exception object.
Parameters
- $object
mixed - $object Object to check.
Returns
boolean - True if argument is an exception, false otherwise.
Since
1.5
|
public static
JException |boolean
|
#
getError( boolean $unset = false )
Method for retrieving the last exception object in the error stack
Method for retrieving the last exception object in the error stack
Parameters
- $unset
boolean - $unset True to remove the error from the stack.
Returns
JException |boolean
- Last JException object in the error stack or boolean false if none exist
Since
1.5
|
public static
JException[]
|
#
getErrors( )
Method for retrieving the exception stack
Method for retrieving the exception stack
Returns
JException[]
- Chronological array of errors that have been stored during script execution
Since
1.5
|
public static
|
#
addToStack( JException & $e )
Method to add non-JError thrown JExceptions to the JError stack for debugging
purposes
Method to add non-JError thrown JExceptions to the JError stack for debugging
purposes
Parameters
- $e
JException - &$e Add an exception to the stack.
Since
1.6
|
public static
JException
|
#
raise( integer $level, string $code, string $msg, mixed $info = null, boolean $backtrace = false )
Create a new JException object given the passed arguments
Create a new JException object given the passed arguments
Parameters
- $level
integer - $level The error level - use any of PHP's own error levels for this: E_ERROR,
E_WARNING, E_NOTICE, E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE.
- $code
string - $code The application-internal error code for this error
- $msg
string - $msg The error message, which may also be shown the user if need be.
- $info
mixed - $info Optional: Additional error information (usually only developer-relevant
information that the user should never see, like a database DSN).
- $backtrace
boolean - $backtrace Add a stack backtrace to the exception.
Returns
Since
1.5
See
|
public static
JException
|
|
public static
JException
|
#
raiseError( string $code, string $msg, mixed $info = null )
Wrapper method for the raise() method with predefined error level of E_ERROR
and backtrace set to true.
Wrapper method for the raise() method with predefined error level of E_ERROR
and backtrace set to true.
Parameters
- $code
string - $code The application-internal error code for this error
- $msg
string - $msg The error message, which may also be shown the user if need be.
- $info
mixed - $info Optional: Additional error information (usually only developer-relevant
information that the user should never see, like a database DSN).
Returns
Since
1.5
See
|
public static
JException
|
#
raiseWarning( string $code, string $msg, mixed $info = null )
Wrapper method for the JError::raise() method with predefined error level of
E_WARNING and backtrace set to false.
Wrapper method for the JError::raise() method with predefined error level of
E_WARNING and backtrace set to false.
Parameters
- $code
string - $code The application-internal error code for this error
- $msg
string - $msg The error message, which may also be shown the user if need be.
- $info
mixed - $info Optional: Additional error information (usually only developer-relevant
information that the user should never see, like a database DSN).
Returns
Since
1.5
See
|
public static
JException
|
#
raiseNotice( string $code, string $msg, mixed $info = null )
Wrapper method for the JError::raise() method with predefined error level of
E_NOTICE and backtrace set to false.
Wrapper method for the JError::raise() method with predefined error level of
E_NOTICE and backtrace set to false.
Parameters
- $code
string - $code The application-internal error code for this error
- $msg
string - $msg The error message, which may also be shown the user if need be.
- $info
mixed - $info Optional: Additional error information (usually only developer-relevant
information that the user should never see, like a database DSN).
Returns
Since
1.5
See
|
public static
array
|
#
getErrorHandling( integer $level )
Method to get the current error handler settings for a specified error
level.
Method to get the current error handler settings for a specified error
level.
Parameters
- $level
integer - $level The error level to retrieve. This can be any of PHP's own error levels,
e.g. E_ALL, E_NOTICE...
Returns
array - All error handling details
Since
1.5
|
public static
boolean|JException
|
#
setErrorHandling( integer $level, string $mode, mixed $options = null )
Method to set the way the JError will handle different error levels. Use this
if you want to override the default settings.
Method to set the way the JError will handle different error levels. Use this
if you want to override the default settings.
Error handling modes:
- ignore
- echo
- verbose
- die
- message
- log
- callback
You may also set the error handling for several modes at once using PHP's bit
operations. Examples:
- E_ALL = Set the handling for all levels
- E_ERROR | E_WARNING = Set the handling for errors and warnings
- E_ALL ^ E_ERROR = Set the handling for all levels except errors
Parameters
- $level
integer - $level The error level for which to set the error handling
- $mode
string - $mode The mode to use for the error handling.
- $options
mixed - $options Optional: Any options needed for the given mode.
Returns
boolean|JException - True on success or a JException object if failed.
Since
1.5
|
public static
|
#
attachHandler( )
Method that attaches the error handler to JError
Method that attaches the error handler to JError
Since
1.5
See
set_error_handler
|
public static
|
#
detachHandler( )
Method that detaches the error handler from JError
Method that detaches the error handler from JError
Since
1.5
See
restore_error_handler
|
public static
boolean
|
#
registerErrorLevel( integer $level, string $name, string $handler = 'ignore' )
Method to register a new error level for handling errors
Method to register a new error level for handling errors
This allows you to add custom error levels to the built-in
- E_NOTICE
- E_WARNING
- E_NOTICE
Parameters
- $level
integer - $level Error level to register
- $name
string - $name Human readable name for the error level
- $handler
string - $handler Error handler to set for the new error level [optional]
Returns
boolean - True on success; false if the level already has been registered
Since
1.5
|
public static
string|boolean
|
#
translateErrorLevel( integer $level )
Translate an error level integer to a human readable string e.g. E_ERROR will
be translated to 'Error'
Translate an error level integer to a human readable string e.g. E_ERROR will
be translated to 'Error'
Parameters
- $level
integer - $level Error level to translate
Returns
string|boolean - Human readable error level name or boolean false if it doesn't exist
Since
1.5
|
public static
JException
|
#
handleIgnore( JException & $error, array $options )
Ignore error handler
Parameters
- $error
JException - &$error Exception object to handle
- $options
array - $options Handler options
Returns
Since
1.5
See
|
public static
JException
|
#
handleEcho( JException & $error, array $options )
Echo error handler
- Echos the error message to output
Echo error handler
- Echos the error message to output
Parameters
- $error
JException - &$error Exception object to handle
- $options
array - $options Handler options
Returns
Since
1.5
See
|
public static
JException
|
#
handleVerbose( JException & $error, array $options )
Verbose error handler
- Echos the error message to output as well as related info
Verbose error handler
- Echos the error message to output as well as related info
Parameters
- $error
JException - &$error Exception object to handle
- $options
array - $options Handler options
Returns
Since
1.5
See
|
public static
|
#
handleDie( JException & $error, array $options )
Die error handler
- Echos the error message to output and then dies
Die error handler
- Echos the error message to output and then dies
Parameters
- $error
JException - &$error Exception object to handle
- $options
array - $options Handler options
Returns
- Calls die()
Since
1.5
See
|
public static
JException
|
#
handleMessage( JException & $error, array $options )
Message error handler Enqueues the error message into the system queue
Message error handler Enqueues the error message into the system queue
Parameters
- $error
JException - &$error Exception object to handle
- $options
array - $options Handler options
Returns
Since
1.5
See
|
public static
JException
|
#
handleLog( JException & $error, array $options )
Log error handler Logs the error message to a system log file
Log error handler Logs the error message to a system log file
Parameters
- $error
JException - &$error Exception object to handle
- $options
array - $options Handler options
Returns
Since
1.5
See
|
public static
JException
|
#
handleCallback( JException & $error, array $options )
Callback error handler
- Send the error object to a callback method for error handling
Callback error handler
- Send the error object to a callback method for error handling
Parameters
- $error
JException - &$error Exception object to handle
- $options
array - $options Handler options
Returns
Since
1.5
See
|
public static
|
#
customErrorPage( JException $error )
Display a custom error page and exit gracefully
Display a custom error page and exit gracefully
Parameters
Since
1.5
|
public static
|
#
customErrorHandler( integer $level, string $msg )
Display a message to the user
Display a message to the user
Parameters
- $level
integer - $level The error level - use any of PHP's own error levels for this: E_ERROR,
E_WARNING, E_NOTICE, E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE.
- $msg
string - $msg Error message, shown to user if need be.
Since
1.5
|
public static
string
|
|