code/error/error.php
public static function setErrorHandling($level, $mode, $options = null)
	{
		JLog::add('JError::setErrorHandling() is deprecated.', JLog::WARNING, 'deprecated');

		$levels = self::$levels;

		$function = 'handle' . ucfirst($mode);

		if (!is_callable(array('JError', $function)))
		{
			return self::raiseError(E_ERROR, 'JError:' . JERROR_ILLEGAL_MODE, 'Error Handling mode is not known', 'Mode: ' . $mode . ' is not implemented.');
		}

		foreach ($levels as $eLevel => $eTitle)
		{
			if (($level & $eLevel) != $eLevel)
			{
				continue;
			}

			// Set callback options
			if ($mode == 'callback')
			{
				if (!is_array($options))
				{
					return self::raiseError(E_ERROR, 'JError:' . JERROR_ILLEGAL_OPTIONS, 'Options for callback not valid');
				}

				if (!is_callable($options))
				{
					$tmp = array('GLOBAL');

					if (is_array($options))
					{
						$tmp[0] = $options[0];
						$tmp[1] = $options[1];
					}
					else
					{
						$tmp[1] = $options;
					}

					return self::raiseError(
						E_ERROR,
						'JError:' . JERROR_CALLBACK_NOT_CALLABLE,
						'Function is not callable',
						'Function:' . $tmp[1] . ' scope ' . $tmp[0] . '.'
					);
				}
			}

			// Save settings
			self::$handlers[$eLevel] = array('mode' => $mode);

			if ($options != null)
			{
				self::$handlers[$eLevel]['options'] = $options;
			}
		}

		return true;
	}
public static function setErrorHandling($level, $mode, $options = null)
	{
		JLog::add('JError::setErrorHandling() is deprecated.', JLog::WARNING, 'deprecated');

		$levels = self::$levels;

		$function = 'handle' . ucfirst($mode);

		if (!is_callable(array('JError', $function)))
		{
			return self::raiseError(E_ERROR, 'JError:' . JERROR_ILLEGAL_MODE, 'Error Handling mode is not known', 'Mode: ' . $mode . ' is not implemented.');
		}

		foreach ($levels as $eLevel => $eTitle)
		{
			if (($level & $eLevel) != $eLevel)
			{
				continue;
			}

			// Set callback options
			if ($mode == 'callback')
			{
				if (!is_array($options))
				{
					return self::raiseError(E_ERROR, 'JError:' . JERROR_ILLEGAL_OPTIONS, 'Options for callback not valid');
				}

				if (!is_callable($options))
				{
					$tmp = array('GLOBAL');

					if (is_array($options))
					{
						$tmp[0] = $options[0];
						$tmp[1] = $options[1];
					}
					else
					{
						$tmp[1] = $options;
					}

					return self::raiseError(
						E_ERROR,
						'JError:' . JERROR_CALLBACK_NOT_CALLABLE,
						'Function is not callable',
						'Function:' . $tmp[1] . ' scope ' . $tmp[0] . '.'
					);
				}
			}

			// Save settings
			self::$handlers[$eLevel] = array('mode' => $mode);

			if ($options != null)
			{
				self::$handlers[$eLevel]['options'] = $options;
			}
		}

		return true;
	}
public static function setErrorHandling ( $ level , $ mode , $ options = null ) { JLog :: add ( 'JError::setErrorHandling() is deprecated.' , JLog :: WARNING , 'deprecated' ) ; $ levels = self :: $ levels ; $ function = 'handle' . ucfirst ( $ mode ) ; if ( ! is_callable ( array ( 'JError' , $ function ) ) ) { return self :: raiseError ( E_ERROR , 'JError:' . JERROR_ILLEGAL_MODE , 'Error Handling mode is not known' , 'Mode: ' . $ mode . ' is not implemented.' ) ; } foreach ( $ levels as $ eLevel => $ eTitle ) { if ( ( $ level & $ eLevel ) != $ eLevel ) { continue ; } // Set callback options if ( $ mode == 'callback' ) { if ( ! is_array ( $ options ) ) { return self :: raiseError ( E_ERROR , 'JError:' . JERROR_ILLEGAL_OPTIONS , 'Options for callback not valid' ) ; } if ( ! is_callable ( $ options ) ) { $ tmp = array ( 'GLOBAL' ) ; if ( is_array ( $ options ) ) { $ tmp [ 0 ] = $ options [ 0 ] ; $ tmp [ 1 ] = $ options [ 1 ] ; } else { $ tmp [ 1 ] = $ options ; } return self :: raiseError ( E_ERROR , 'JError:' . JERROR_CALLBACK_NOT_CALLABLE , 'Function is not callable' , 'Function:' . $ tmp [ 1 ] . ' scope ' . $ tmp [ 0 ] . '.' ) ; } } // Save settings self :: $ handlers [ $ eLevel ] = array ( 'mode' => $ mode ) ; if ( $ options != null ) { self :: $ handlers [ $ eLevel ] [ 'options' ] = $ options ; } } return true ; }
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

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

@return  boolean|JException  True on success or a JException object if failed.

@deprecated  12.1  Use PHP Exception
@since   11.1
Method to set the way the JError will handle different error levels . Use this if you want to override the default settings .