Documentation

JsonRpcMethodException extends CRM_Core_Exception
in package

The JsonRpcMethodException is emitted by a JSON-RPC client if a method call returns an error.

This differs from an protocol-error or client-error. In this case, all JSON-RPC traffic has been well-formed; but the payload indicates that a specific method-call failed.

Table of Contents

Constants

NOT_IMPLEMENTED  = 'not-found'
UNAUTHORIZED  = 'unauthorized'

Properties

$raw  : array<string|int, mixed>
$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

Methods

__construct()

Class constructor.

public __construct(array<string|int, mixed> $jsonRpcError) : mixed
Parameters
$jsonRpcError : array<string|int, mixed>

__toString()

Custom string representation of object.

public __toString() : string
Return values
string

getErrorCode()

Get error code.

public getErrorCode() : int|string
Return values
int|string

getErrorCodes()

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
Return values
string

        
On this page

Search results