UnauthorizedException
extends CRM_Core_Exception
in package
Class UnauthorizedException
Table of Contents
Constants
- NOT_IMPLEMENTED = 'not-found'
- UNAUTHORIZED = 'unauthorized'
Properties
- $errorData : mixed
Methods
- __construct() : mixed
- Class constructor.
- __toString() : string
- Custom string representation of object.
- getErrorCode() : int|string
- Get error code.
- getErrorCodes() : array<string|int, mixed>
- Get error codes.
- getErrorData() : array<string|int, mixed>
- Return specific error information.
- getExtraParams() : array<string|int, mixed>
- Get extra parameters.
- getUserMessage() : string
- Get a message suitable to be presented to the user.
Constants
NOT_IMPLEMENTED
public
mixed
NOT_IMPLEMENTED
= 'not-found'
UNAUTHORIZED
public
mixed
UNAUTHORIZED
= 'unauthorized'
Properties
$errorData
private
mixed
$errorData
= []
Methods
__construct()
Class constructor.
public
__construct(string $message[, array<string|int, mixed> $extraParams = [] ][, Exception|null $previous = NULL ]) : mixed
Parameters
- $message : string
-
The human friendly error message.
- $extraParams : array<string|int, mixed> = []
-
Extra params to return. eg an extra array of ids. It is not mandatory, but can help the computer using the api. Keep in mind the api consumer isn't to be trusted. eg. the database password is NOT a good extra data.
- $previous : Exception|null = NULL
-
A previous exception which caused this new exception.
__toString()
Custom string representation of object.
public
__toString() : string
Return values
stringgetErrorCode()
Get error code.
public
getErrorCode() : int|string
Return values
int|stringgetErrorCodes()
Get error codes.
public
getErrorCodes() : array<string|int, mixed>
DIVERGENCE: API_Exception defined a discoverable list of error-codes. CRM_Core_Exception and CiviCRM_API3_Exception did not.
Return values
array<string|int, mixed>getErrorData()
Return specific error information.
public
getErrorData() : array<string|int, mixed>
(Can be used for more detailed error messages or translation.)
This method may be overridden in child exception classes in order to add functionality not present in PEAR_Exception and is a placeholder to define API
The returned array must be an associative array of parameter => value like so:
array('name' => $name, 'context' => array(...))
Return values
array<string|int, mixed>getExtraParams()
Get extra parameters.
public
getExtraParams() : array<string|int, mixed>
Remove in v6.0. Compatibility with older API_Exception/CiviCRM_API3_Exception contracts.
Return values
array<string|int, mixed>getUserMessage()
Get a message suitable to be presented to the user.
public
getUserMessage() : string