class JException extends Exception

Joomla! Exception object.

Methods

__construct( string $msg, integer $code, integer $level = null, string $info = null, boolean $backtrace = false)

Constructor - used to set up the error with all needed error details.

string
__toString()

Returns to error message

string
toString()

Returns to error message

mixed
get( string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

array
getProperties( boolean $public = true)

Returns an associative array of object properties

string
getError( integer $i = null, boolean $toString = true)

Get the most recent error message

array
getErrors()

Return all errors, if any

mixed
set( string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

boolean
setProperties( mixed $properties)

Set the object properties based on a named array/hash

void
setError( string $error)

Add an error message

Details

__construct( string $msg, integer $code, integer $level = null, string $info = null, boolean $backtrace = false)

Constructor - used to set up the error with all needed error details.

Parameters

string $msg The error message
integer $code The error code from the application
integer $level The error level (use the PHP constants EALL, ENOTICE etc.).
string $info Optional: The additional error information.
boolean $backtrace True if backtrace information is to be collected

string __toString()

Returns to error message

Return Value

string Error message

string toString()

Returns to error message

Return Value

string Error message

mixed get( string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

Parameters

string $property The name of the property
mixed $default The default value

Return Value

mixed The value of the property or null

See also

JException::getProperties()

array getProperties( boolean $public = true)

Returns an associative array of object properties

Parameters

boolean $public If true, returns only the public properties

Return Value

array Object properties

See also

JException::get()

string getError( integer $i = null, boolean $toString = true)

Get the most recent error message

Parameters

integer $i Option error index
boolean $toString Indicates if JError objects should return their error message

Return Value

string Error message

array getErrors()

Return all errors, if any

Return Value

array Array of error messages or JErrors

mixed set( string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

Parameters

string $property The name of the property
mixed $value The value of the property to set

Return Value

mixed Previous value of the property

See also

JException::setProperties()

boolean setProperties( mixed $properties)

Set the object properties based on a named array/hash

Parameters

mixed $properties Either and associative array or another object

Return Value

boolean

See also

JException::set()

void setError( string $error)

Add an error message

Parameters

string $error Error message

Return Value

void