LegacyErrorHandlingTrait
Trait which contains the legacy methods that formerly were inherited from \Joomla\CMS\Object\CMSObject to set and get errors in a class.
| since |
4.3.0 |
|---|---|
| deprecated |
4.3 will be removed in 6.0 Will be removed without replacement Throw an Exception instead of setError |
| package |
Joomla CMS |
Methods
getError
Get the most recent error message.
getError( i = null, toString = true) :
| since |
1.7.0 |
|---|---|
| deprecated |
3.1.4 will be removed in 6.0 Will be removed without replacement Catch thrown Exceptions instead of getError |
Arguments
- i
intOption error index.- toString
boolIndicates if Exception objects should return their error message.
Response
stringError message
getErrors
Return all errors, if any.
getErrors() : mixed||string|int
| since |
1.7.0 |
|---|---|
| deprecated |
3.1.4 will be removed in 6.0 Will be removed without replacement Catch thrown Exceptions instead of getErrors |
Response
array<string|int, mixed>Array of error messages.
setError
Add an error message.
setError( error) :
| since |
1.7.0 |
|---|---|
| deprecated |
3.1.4 will be removed in 6.0 Will be removed without replacement Throw an Exception instead of using setError |
Arguments
- error
stringError message.
Response
void
Properties
_errors
An array of error messages or Exception objects.
| since |
1.7.0 |
|---|---|
| deprecated |
3.1.4 JError has been deprecated |
Type(s)
array<string|int, mixed>