Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Joomla-Framework

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5

 Class JError

Description

Error Handling Class

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

patErrorManager contributors include:

Located in /joomla/utilities/error.php (line 61)

Class JError   (Subpackage Utilities)
Method Summary
Static method static void customErrorPage ( &$error, object $error)
Static method static mixed &getError ([ $unset = false])
Static method static array getErrorHandling (int $level)
Static method static array &getErrors ()
Static method static object The &handleCallback ( &$error, array $options, object $error)
Static method static object The &handleDie ( &$error, array $options, object $error)
Static method static object The &handleEcho ( &$error, array $options, object $error)
Static method static object The &handleIgnore ( &$error, array $options, object $error)
Static method static object The &handleLog ( &$error, array $options, object $error)
Static method static object The &handleMessage ( &$error, array $options, object $error)
Static method static object The &handleTrigger ( &$error, array $options, object $error)
Static method static object The &handleVerbose ( &$error, array $options, object $error)
Static method static boolean isError (mixed &$object)
Static method static mixed &raise (int $level, string $code, string $msg, [mixed $info = null], [ $backtrace = false])
Static method static object &raiseError (string $code, string $msg, [mixed $info = null])
Static method static object &raiseNotice (string $code, string $msg, [mixed $info = null])
Static method static object &raiseWarning (string $code, string $msg, [mixed $info = null])
Static method static boolean registerErrorLevel (int $level, string $name, [string $handler = 'ignore'])
Static method static mixed setErrorHandling (int $level, string $mode, [mixed $options = null])
Static method static mixed translateErrorLevel (int $level)
Methods
customErrorPage (line 549)

Display a custom error page and exit gracefully

  • since: 1.5
void customErrorPage ( &$error, object $error)
  • object $error: Exception object
  • &$error
getError (line 89)

Method for retrieving the last exception object in the error stack

  • return: Last exception object in the error stack or boolean false if none exist
  • since: 1.5
  • access: public
mixed &getError ([ $unset = false])
  • $unset
getErrorHandling (line 211)

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

  • return: All error handling details
  • since: 1.5
array getErrorHandling (int $level)
  • int $level: The error level to retrieve. This can be any of PHP's own error levels, e.g. E_ALL, E_NOTICE...
getErrors (line 111)

Method for retrieving the exception stack

  • return: Chronological array of errors that have been stored during script execution
  • since: 1.5
  • access: public
array &getErrors ()
handleCallback (line 535)

Callback error handler

  • Send the error object to a callback method for error handling

object The &handleCallback ( &$error, array $options, object $error)
  • object $error: Exception object to handle
  • array $options: Handler options
  • &$error
handleDie (line 421)

Die error handler

  • Echos the error message to output and then dies

object The &handleDie ( &$error, array $options, object $error)
  • object $error: Exception object to handle
  • array $options: Handler options
  • &$error
handleEcho (line 356)

Echo error handler

  • Echos the error message to output

object The &handleEcho ( &$error, array $options, object $error)
  • object $error: Exception object to handle
  • array $options: Handler options
  • &$error
handleIgnore (line 339)

Ignore error handler

  • Ignores the error

object The &handleIgnore ( &$error, array $options, object $error)
  • object $error: Exception object to handle
  • array $options: Handler options
  • &$error
handleLog (line 470)

Log error handler

  • Logs the error message to a system log file

object The &handleLog ( &$error, array $options, object $error)
  • object $error: Exception object to handle
  • array $options: Handler options
  • &$error
handleMessage (line 451)

Message error handler

  • Enqueues the error message into the system queue

object The &handleMessage ( &$error, array $options, object $error)
  • object $error: Exception object to handle
  • array $options: Handler options
  • &$error
handleTrigger (line 501)

Trigger error handler

  • Triggers a PHP native error with the error message

object The &handleTrigger ( &$error, array $options, object $error)
  • object $error: Exception object to handle
  • array $options: Handler options
  • &$error
handleVerbose (line 386)

Verbose error handler

  • Echos the error message to output as well as related info

object The &handleVerbose ( &$error, array $options, object $error)
  • object $error: Exception object to handle
  • array $options: Handler options
  • &$error
isError (line 72)

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

  • return: True if argument is an exception, false otherwise.
  • since: 1.5
  • access: public
boolean isError (mixed &$object)
  • mixed &$object: Object to check
raise (line 129)

Create a new JException object given the passed arguments

  • return: The JException object
  • see: JException
  • since: 1.5
mixed &raise (int $level, string $code, string $msg, [mixed $info = null], [ $backtrace = false])
  • int $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.
  • 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).
  • $backtrace
raiseError (line 165)

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

  • return: The configured JError object
  • since: 1.5
object &raiseError (string $code, string $msg, [mixed $info = null])
  • 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).
raiseNotice (line 197)

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

  • return: The configured JError object
  • since: 1.5
object &raiseNotice (string $code, string $msg, [mixed $info = null])
  • 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).
raiseWarning (line 181)

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

  • return: The configured JError object
  • since: 1.5
object &raiseWarning (string $code, string $msg, [mixed $info = null])
  • 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).
registerErrorLevel (line 300)

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

  • return: True on success; false if the level already has been registered
  • since: 1.5
boolean registerErrorLevel (int $level, string $name, [string $handler = 'ignore'])
  • int $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]
setErrorHandling (line 242)

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
  • trigger
  • 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

  • return: True on success, or a JException object if failed.
  • since: 1.5
mixed setErrorHandling (int $level, string $mode, [mixed $options = null])
  • int $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.
translateErrorLevel (line 319)

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

  • return: Human readable error level name or boolean false if it doesn't exist
  • since: 1.5
mixed translateErrorLevel (int $level)
  • int $level: Error level to translate

Documentation generated on Mon, 05 Mar 2007 20:57:47 +0000 by phpDocumentor 1.3.1