Methods

Constructor

__construct(string $message, int $code, mixed $data) 

Parameters

$message

string

$code

int

$data

mixed

Cast to string (JSON)

__toString() : string

Returns

string

Get error code

getCode() : int | null

Returns

intnull

Get error data

getData() : mixed

Returns

mixed

Get error message

getMessage() : string

Returns

string

Set error code

setCode(int $code) : \Zend\Json\Server\Error

Parameters

$code

int

Returns

Set error data

setData(mixed $data) : \Zend\Json\Server\Error

Parameters

$data

mixed

Returns

Set error message

setMessage(string $message) : \Zend\Json\Server\Error

Parameters

$message

string

Returns

Cast error to array

toArray() : array

Returns

array

Cast error to JSON

toJson() : string

Returns

string

 Properties

 

Allowed error codes

$allowedCodes : array

 

Current code

$code : int

 

Error data

$data : mixed

 

Error message

$message : string

 Constants

 

ERROR_INTERNAL

ERROR_INTERNAL 

 

ERROR_INVALID_METHOD

ERROR_INVALID_METHOD 

 

ERROR_INVALID_PARAMS

ERROR_INVALID_PARAMS 

 

ERROR_INVALID_REQUEST

ERROR_INVALID_REQUEST 

 

ERROR_OTHER

ERROR_OTHER 

 

ERROR_PARSE

ERROR_PARSE