JException

Extends \Exception

Joomla! Exception object.

deprecated
since

1.5

deprecated

1.7

package

Joomla.Legacy

Methods

__construct

Constructor

  • used to set up the error with all needed error details.
__construct(string $msg, integer $code, integer $level = null, string $info = null, boolean $backtrace = false) 
deprecated
since

1.5

deprecated

1.7

Arguments

$msg

stringThe error message

$code

integerThe error code from the application

$level

integerThe error level (use the PHP constants E_ALL, E_NOTICE etc.).

$info

stringOptional: The additional error information.

$backtrace

booleanTrue if backtrace information is to be collected

__toString

Returns to error message

__toString() : string
deprecated
since

1.6

deprecated

1.7

Response

stringError message

get

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

get(string $property, mixed $default = null) : mixed
deprecated
since

1.6

deprecated

1.7

see \JException::getProperties()

Arguments

$property

stringThe name of the property

$default

mixedThe default value

Response

mixedThe value of the property or null

getError

Get the most recent error message

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

1.6

deprecated

1.7

Arguments

$i

integerOption error index

$toString

booleanIndicates if JError objects should return their error message

Response

stringError message

getErrors

Return all errors, if any

getErrors() : array
deprecated
since

1.6

deprecated

1.7

Response

arrayArray of error messages or JErrors

getProperties

Returns an associative array of object properties

getProperties(boolean $public = true) : array
deprecated
since

1.6

deprecated

1.7

see \JException::get()

Arguments

$public

booleanIf true, returns only the public properties

Response

arrayObject properties

set

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

set(string $property, mixed $value = null) : mixed
deprecated
since

1.6

deprecated

1.7

see \JException::setProperties()

Arguments

$property

stringThe name of the property

$value

mixedThe value of the property to set

Response

mixedPrevious value of the property

setError

Add an error message

setError(string $error) : void
deprecated
since

1.6

deprecated

1.7

Arguments

$error

stringError message

setProperties

Set the object properties based on a named array/hash

setProperties(mixed $properties) : boolean
deprecated
since

1.6

deprecated

1.7

see \JException::set()

Arguments

$properties

mixedEither and associative array or another object

Response

boolean

toString

Returns to error message

toString() : string
deprecated
since

1.5

deprecated

1.7

Response

stringError message

Properties

level

Error level.

deprecated
since

1.5

deprecated

1.7

Type(s)

string

code

Error code.

deprecated
since

1.5

deprecated

1.7

Type(s)

string

message

Error message.

deprecated
since

1.5

deprecated

1.7

Type(s)

string

info

Additional info about the error relevant to the developer, for example, if a database connect fails, the dsn used

deprecated
since

1.5

deprecated

1.7

Type(s)

string

file

Name of the file the error occurred in [Available if backtrace is enabled]

deprecated
since

1.5

deprecated

1.7

Type(s)

string

line

Line number the error occurred in [Available if backtrace is enabled]

deprecated
since

1.5

deprecated

1.7

Type(s)

integer

function

Name of the method the error occurred in [Available if backtrace is enabled]

deprecated
since

1.5

deprecated

1.7

Type(s)

string

class

Name of the class the error occurred in [Available if backtrace is enabled]

deprecated
since

1.5

deprecated

1.7

Type(s)

string

type

Error type.

deprecated
since

1.5

deprecated

1.7

Type(s)

string

args

Arguments received by the method the error occurred in [Available if backtrace is enabled]

deprecated
since

1.5

deprecated

1.7

Type(s)

array

backtrace

Backtrace information.

deprecated
since

1.5

deprecated

1.7

Type(s)

mixed

_errors

Container holding the error messages

deprecated
since

1.6

deprecated

1.7

Type(s)

array<mixed,string>