Zend\Json\Server\Error
Synopsis
class Error
{
- // constants
- const ERROR_PARSE = 32700;
- const ERROR_INVALID_REQUEST = 32600;
- const ERROR_INVALID_METHOD = 32601;
- const ERROR_INVALID_PARAMS = 32602;
- const ERROR_INTERNAL = 32603;
- const ERROR_OTHER = 32000;
- // methods
- public void __construct()
- public Error setCode()
- public int|null getCode()
- public Error setMessage()
- public string getMessage()
- public Error setData()
- public mixed getData()
- public array toArray()
- public string toJson()
- public string __toString()
Constants
Name | Value |
---|---|
ERROR_PARSE | 32700 |
ERROR_INVALID_REQUEST | 32600 |
ERROR_INVALID_METHOD | 32601 |
ERROR_INVALID_PARAMS | 32602 |
ERROR_INTERNAL | 32603 |
ERROR_OTHER | 32000 |
Members
protected
- $code
—
int
Current code - $data
—
mixed
Error data - $message
—
string
Error message
Methods
public
- __construct() — Constructor
- __toString() — Cast to string (JSON)
- getCode() — Get error code
- getData() — Get error data
- getMessage() — Get error message
- setCode() — Set error code.
- setData() — Set error data
- setMessage() — Set error message
- toArray() — Cast error to array
- toJson() — Cast error to JSON