Naux\Mail\SendCloudTransport::response PHP Method

response() protected method

解析 SendCloud 返回值,失败抛出异常.
protected response ( Psr\Http\Message\ResponseInterface $response ) : boolean
$response Psr\Http\Message\ResponseInterface
return boolean
    protected function response(ResponseInterface $response)
    {
        $res = json_decode($response->getBody()->getContents());
        if (isset($res->errors)) {
            throw new SendCloudException(array_get($res->errors, 0));
        }
        return true;
    }