Definition at line 28 of file Error.php.
◆ __construct()
__construct |
( |
|
$message = null , |
|
|
|
$code = -32000 , |
|
|
|
$data = null |
|
) |
| |
Constructor
- Parameters
-
string | $message | |
int | $code | |
mixed | $data | |
- Returns
- void
Definition at line 76 of file Error.php.
◆ __toString()
Cast to string (JSON)
- Returns
- string
Definition at line 193 of file Error.php.
◆ getCode()
Get error code
- Returns
- int|null
Definition at line 110 of file Error.php.
◆ getData()
Get error data
- Returns
- mixed
Definition at line 158 of file Error.php.
◆ getMessage()
Get error message
- Returns
- string
Definition at line 136 of file Error.php.
◆ setCode()
Set error code
- Parameters
-
- Returns
- Zend_Json_Server_Error
Definition at line 89 of file Error.php.
91 if (!is_scalar(
$code)) {
96 if (in_array(
$code, $this->_allowedCodes)) {
elseif(isset( $params[ 'redirect_parent']))
◆ setData()
◆ setMessage()
◆ toArray()
Cast error to array
- Returns
- array
Definition at line 168 of file Error.php.
◆ toJson()
Cast error to JSON
- Returns
- string
Definition at line 182 of file Error.php.
184 #require_once 'Zend/Json.php';
static encode($valueToEncode, $cycleCheck=false, $options=array())
◆ $_allowedCodes
Initial value:= array(
self::ERROR_PARSE,
self::ERROR_INVALID_REQUEST,
self::ERROR_INVALID_METHOD,
self::ERROR_INVALID_PARAMS,
self::ERROR_INTERNAL,
self::ERROR_OTHER,
)
Definition at line 41 of file Error.php.
◆ $_code
◆ $_data
◆ $_message
◆ ERROR_INTERNAL
const ERROR_INTERNAL = -32603 |
◆ ERROR_INVALID_METHOD
const ERROR_INVALID_METHOD = -32601 |
◆ ERROR_INVALID_PARAMS
const ERROR_INVALID_PARAMS = -32602 |
◆ ERROR_INVALID_REQUEST
const ERROR_INVALID_REQUEST = -32600 |
◆ ERROR_OTHER
const ERROR_OTHER = -32000 |
◆ ERROR_PARSE
const ERROR_PARSE = -32768 |
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Json/Server/Error.php