category Zend
package Zend_Json
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Constructor

__construct(string $message = null, integer $code = -32000, mixed $data = null) : void

Parameters

$message

string

$code

integer

$data

mixed

Cast to string (JSON)

__toString() : string

Returns

string

Get error code

getCode() : integer | null

Returns

integernull

Get error data

getData() : mixed

Returns

mixed

Get error message

getMessage() : string

Returns

string

Set error code

setCode(integer $code) : \Zend_Json_Server_Error

Parameters

$code

integer

Returns

\Zend_Json_Server_Error

Set error data

setData(mixed $data) : \Zend_Json_Server_Error

Parameters

$data

mixed

Returns

\Zend_Json_Server_Error

Set error message

setMessage(string $message) : \Zend_Json_Server_Error

Parameters

$message

string

Returns

\Zend_Json_Server_Error

Cast error to array

toArray() : array

Returns

array

Cast error to JSON

toJson() : string

Returns

string

 Properties

 

Allowed error codes

$_allowedCodes : array

Default

array(self::ERROR_PARSE, self::ERROR_INVALID_REQUEST, self::ERROR_INVALID_METHOD, self::ERROR_INVALID_PARAMS, self::ERROR_INTERNAL, self::ERROR_OTHER)
 

Current code

$_code : integer

Default

-32000
 

Error data

$_data : mixed

Default

 

Error message

$_message : string

Default

 Constants

 

ERROR_INTERNAL

ERROR_INTERNAL = -32603 
 

ERROR_INVALID_METHOD

ERROR_INVALID_METHOD = -32601 
 

ERROR_INVALID_PARAMS

ERROR_INVALID_PARAMS = -32602 
 

ERROR_INVALID_REQUEST

ERROR_INVALID_REQUEST = -32600 
 

ERROR_OTHER

ERROR_OTHER = -32000 
 

ERROR_PARSE

ERROR_PARSE = -32768