JException
Extends \ExceptionJoomla! Exception object.
| package |
Joomla.Platform |
|---|---|
| subpackage |
Error |
| since |
11.1 |
| deprecated |
12.1 |
Methods
__construct
Constructor
- used to set up the error with all needed error details.
__construct(string $msg, string $code, integer $level = null, string $info = null, boolean $backtrace = false)
| since |
11.1 |
|---|---|
| deprecated |
12.1 |
Arguments
- $msg
stringThe error message- $code
stringThe 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
| since |
11.1 |
|---|---|
| deprecated |
12.1 |
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 |
12.1 |
|---|---|
| see | \JException::getProperties() |
| since |
11.1 |
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
| since |
11.1 |
|---|---|
| deprecated |
12.1 |
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
| since |
11.1 |
|---|---|
| deprecated |
12.1 |
Response
arrayArray of error messages or JErrors
getProperties
Returns an associative array of object properties
getProperties(boolean $public = true) : array
| deprecated |
12.1 |
|---|---|
| see | \JException::get() |
| since |
11.1 |
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 |
12.1 |
|---|---|
| see | \JException::setProperties() |
| since |
11.1 |
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
| since |
11.1 |
|---|---|
| deprecated |
12.1 |
Arguments
- $error
stringError message
setProperties
Set the object properties based on a named array/hash
setProperties(mixed $properties) : boolean
| deprecated |
12.1 |
|---|---|
| see | \JException::set() |
| since |
11.1 |
Arguments
- $properties
mixedEither and associative array or another object
Response
boolean
toString
Returns to error message
toString() : string
| since |
11.1 |
|---|---|
| deprecated |
12.1 |
Response
stringError message
Properties
level
Error level.
| since |
11.1 |
|---|
Type(s)
string
code
Error code.
| since |
11.1 |
|---|
Type(s)
string
message
Error message.
| since |
11.1 |
|---|
Type(s)
string
info
Additional info about the error relevant to the developer, for example, if a database connect fails, the dsn used
| since |
11.1 |
|---|
Type(s)
string
file
Name of the file the error occurred in [Available if backtrace is enabled]
| since |
11.1 |
|---|
Type(s)
string
line
Line number the error occurred in [Available if backtrace is enabled]
| since |
11.1 |
|---|
Type(s)
integer
function
Name of the method the error occurred in [Available if backtrace is enabled]
| since |
11.1 |
|---|
Type(s)
string
class
Name of the class the error occurred in [Available if backtrace is enabled]
| since |
11.1 |
|---|
Type(s)
string
type
Error type.
| since |
11.1 |
|---|
Type(s)
string
args
Arguments recieved by the method the error occurred in [Available if backtrace is enabled]
| since |
11.1 |
|---|
Type(s)
array
backtrace
Backtrace information.
| since |
11.1 |
|---|
Type(s)
mixed