class JError


Located at : UKNOWVA_ROOT/libraries/joomla/error/error.php

deprecated 12.1 Use PHP Exception

Error Handling Class

This class is inspired in design and concept by patErrorManager http://www.php-tools.net

patErrorManager contributors include: - gERD Schaufelberger gerd@php-tools.net - Sebastian Mordziol argh@php-tools.net - Stephan Schmidt scst@php-tools.net

Properties

static boolean $legacy

Methods

static boolean
isError(mixed $object) deprecated

Method to determine if a value is an exception object. This check supports both JException and PHP5 Exception objects

static mixed
getError(boolean $unset = false) deprecated

Method for retrieving the last exception object in the error stack

static array
getErrors() deprecated

Method for retrieving the exception stack

static void
addToStack(JException $e) deprecated

Method to add non-JError thrown JExceptions to the JError stack for debugging purposes

static mixed
raise(integer $level, string $code, string $msg, mixed $info = null, boolean $backtrace = false) deprecated

Create a new JException object given the passed arguments

static reference
throwError(object $exception) deprecated

Throw an error

static object
raiseError(string $code, string $msg, mixed $info = null) deprecated

Wrapper method for the raise() method with predefined error level of E_ERROR and backtrace set to true.

static object
raiseWarning(string $code, string $msg, mixed $info = null) deprecated

Wrapper method for the {@link raise()} method with predefined error level of E_WARNING and backtrace set to false.

static object
raiseNotice(string $code, string $msg, mixed $info = null) deprecated

Wrapper method for the {@link raise()} method with predefined error level of E_NOTICE and backtrace set to false.

static array
getErrorHandling(integer $level) deprecated

Method to get the current error handler settings for a specified error level.

static mixed
setErrorHandling(integer $level, string $mode, mixed $options = null) deprecated

Method to set the way the JError will handle different error levels. Use this if you want to override the default settings.

static void
attachHandler() deprecated

Method that attaches the error handler to JError

static 
detachHandler()

Method that detaches the error handler from JError

static boolean
registerErrorLevel(integer $level, string $name, string $handler = 'ignore')

Method to register a new error level for handling errors

static mixed
translateErrorLevel(integer $level) deprecated

Translate an error level integer to a human readable string e.g. E_ERROR will be translated to 'Error'

static object
handleIgnore(object $error, array $options)

Ignore error handler - Ignores the error

static object
handleEcho(object $error, array $options) deprecated

Echo error handler - Echos the error message to output

static object
handleVerbose(object $error, array $options) deprecated

Verbose error handler - Echos the error message to output as well as related info

static object
handleDie(object $error, array $options) deprecated

Die error handler - Echos the error message to output and then dies

static object
handleMessage(object $error, array $options) deprecated

Message error handler Enqueues the error message into the system queue

static object
handleLog(object $error, array $options) deprecated

Log error handler Logs the error message to a system log file

static object
handleCallback(object $error, array $options) deprecated

Callback error handler - Send the error object to a callback method for error handling

static void
customErrorPage(object $error) deprecated

Display a custom error page and exit gracefully

static void
customErrorHandler(integer $level, string $msg) deprecated

Display a custom error page and exit gracefully

static string
renderBacktrace(integer $error) deprecated

Render the backtrace

Details

at line 78
static boolean isError(mixed $object) deprecated

deprecated 12.1

Method to determine if a value is an exception object. This check supports both JException and PHP5 Exception objects

Parameters

mixed $object &$object Object to check

Return Value

boolean True if argument is an exception, false otherwise.

at line 98
static mixed getError(boolean $unset = false) deprecated

deprecated 12.1

Method for retrieving the last exception object in the error stack

Parameters

boolean $unset

Return Value

mixed Last exception object in the error stack or boolean false if none exist

at line 125
static array getErrors() deprecated

deprecated 12.1

Method for retrieving the exception stack

Return Value

array Chronological array of errors that have been stored during script execution

at line 144
static void addToStack(JException $e) deprecated

deprecated 12.1

Method to add non-JError thrown JExceptions to the JError stack for debugging purposes

Parameters

JException $e JException

Return Value

void

at line 167
static mixed raise(integer $level, string $code, string $msg, mixed $info = null, boolean $backtrace = false) deprecated

deprecated 12.1 Use PHP Exception

Create a new JException object given the passed arguments

Parameters

integer $level The error level - use any of PHP's own error levels for this: EERROR, EWARNING, ENOTICE, EUSERERROR, EUSERWARNING, EUSER_NOTICE.
string $code The application-internal error code for this error
string $msg The error message, which may also be shown the user if need be.
mixed $info Optional: Additional error information (usually only developer-relevant information that the user should never see, like a database DSN).
boolean $backtrace

Return Value

mixed The JException object

See also

JException

at line 191
static reference throwError(object $exception) deprecated

deprecated 12.1 Use PHP Exception

Throw an error

Parameters

object $exception

Return Value

reference

See also

JException

at line 245
static object raiseError(string $code, string $msg, mixed $info = null) deprecated

deprecated 12.1 Use PHP Exception

Wrapper method for the raise() method with predefined error level of E_ERROR and backtrace set to true.

Parameters

string $code The application-internal error code for this error
string $msg The error message, which may also be shown the user if need be.
mixed $info Optional: Additional error information (usually only developer-relevant information that the user should never see, like a database DSN).

Return Value

object $error The configured JError object

See also

raise()

at line 269
static object raiseWarning(string $code, string $msg, mixed $info = null) deprecated

deprecated 12.1 Use PHP Exception

Wrapper method for the {@link raise()} method with predefined error level of E_WARNING and backtrace set to false.

Parameters

string $code The application-internal error code for this error
string $msg The error message, which may also be shown the user if need be.
mixed $info Optional: Additional error information (usually only developer-relevant information that the user should never see, like a database DSN).

Return Value

object The configured JError object

See also

JError
raise()

at line 292
static object raiseNotice(string $code, string $msg, mixed $info = null) deprecated

deprecated 12.1 Use PHP Exception

Wrapper method for the {@link raise()} method with predefined error level of E_NOTICE and backtrace set to false.

Parameters

string $code The application-internal error code for this error
string $msg The error message, which may also be shown the user if need be.
mixed $info Optional: Additional error information (usually only developer-relevant information that the user should never see, like a database DSN).

Return Value

object The configured JError object

See also

raise()

at line 311
static array getErrorHandling(integer $level) deprecated

deprecated 12.1 Use PHP Exception

Method to get the current error handler settings for a specified error level.

Parameters

integer $level The error level to retrieve. This can be any of PHP's own error levels, e.g. EALL, ENOTICE...

Return Value

array All error handling details

at line 347
static mixed setErrorHandling(integer $level, string $mode, mixed $options = null) deprecated

deprecated 12.1 Use PHP Exception

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: - EALL = Set the handling for all levels - EERROR | EWARNING = Set the handling for errors and warnings - EALL ^ E_ERROR = Set the handling for all levels except errors

Parameters

integer $level The error level for which to set the error handling
string $mode The mode to use for the error handling.
mixed $options Optional: Any options needed for the given mode.

Return Value

mixed True on success or a JException object if failed.

at line 405
static void attachHandler() deprecated

deprecated 12.1

Method that attaches the error handler to JError

Return Value

void

See also

set_error_handler

at line 421
static detachHandler()

Method that detaches the error handler from JError

See also

restore_error_handler

at line 444
static boolean registerErrorLevel(integer $level, string $name, string $handler = 'ignore')

Method to register a new error level for handling errors

This allows you to add custom error levels to the built-in - ENOTICE - EWARNING - E_NOTICE

Parameters

integer $level Error level to register
string $name Human readable name for the error level
string $handler Error handler to set for the new error level [optional]

Return Value

boolean True on success; false if the level already has been registered

at line 470
static mixed translateErrorLevel(integer $level) deprecated

deprecated

Translate an error level integer to a human readable string e.g. E_ERROR will be translated to 'Error'

Parameters

integer $level Error level to translate

Return Value

mixed Human readable error level name or boolean false if it doesn't exist

at line 494
static object handleIgnore(object $error, array $options)

Ignore error handler - Ignores the error

Parameters

object $error Exception object to handle
array $options Handler options

Return Value

object The exception object

See also

raise()

at line 515
static object handleEcho(object $error, array $options) deprecated

deprecated 12.1

Echo error handler - Echos the error message to output

Parameters

object $error Exception object to handle
array $options Handler options

Return Value

object The exception object

See also

raise()

at line 552
static object handleVerbose(object $error, array $options) deprecated

deprecated 12.1

Verbose error handler - Echos the error message to output as well as related info

Parameters

object $error Exception object to handle
array $options Handler options

Return Value

object The exception object

See also

raise()

at line 595
static object handleDie(object $error, array $options) deprecated

deprecated 12.1

Die error handler - Echos the error message to output and then dies

Parameters

object $error Exception object to handle
array $options Handler options

Return Value

object The exception object

See also

raise()

at line 633
static object handleMessage(object $error, array $options) deprecated

deprecated 12.1

Message error handler Enqueues the error message into the system queue

Parameters

object $error Exception object to handle
array $options Handler options

Return Value

object The exception object

See also

raise()

at line 658
static object handleLog(object $error, array $options) deprecated

deprecated 12.1

Log error handler Logs the error message to a system log file

Parameters

object $error Exception object to handle
array $options Handler options

Return Value

object The exception object

See also

raise()

at line 693
static object handleCallback(object $error, array $options) deprecated

deprecated 12.1

Callback error handler - Send the error object to a callback method for error handling

Parameters

object $error Exception object to handle
array $options Handler options

Return Value

object The exception object

See also

raise()

at line 712
static void customErrorPage(object $error) deprecated

deprecated 12.1

Display a custom error page and exit gracefully

Parameters

object $error Exception object

Return Value

void

at line 760
static void customErrorHandler(integer $level, string $msg) deprecated

deprecated 12.1

Display a custom error page and exit gracefully

Parameters

integer $level The error level - use any of PHP's own error levels for this: EERROR, EWARNING, ENOTICE, EUSERERROR, EUSERWARNING, EUSER_NOTICE.
string $msg Error message, shown to user if need be.

Return Value

void

at line 779
static string renderBacktrace(integer $error) deprecated

deprecated 12.1

Render the backtrace

Parameters

integer $error The error

Return Value

string Contents of the backtrace