in Aliyun/Log/Client.php [171:199]
private function sendRequest($method, $url, $body, $headers) {
try {
list ( $responseCode, $header, $resBody ) =
$this->getHttpResponse ( $method, $url, $body, $headers );
} catch ( Exception $ex ) {
throw new Aliyun_Log_Exception ( $ex->getMessage (), $ex->__toString () );
}
$requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
if ($responseCode == 200) {
return array ($resBody,$header);
}
else {
$exJson = $this->parseToJson ( $resBody, $requestId );
if (isset($exJson ['error_code']) && isset($exJson ['error_message'])) {
throw new Aliyun_Log_Exception ( $exJson ['error_code'],
$exJson ['error_message'], $requestId );
} else {
if ($exJson) {
$exJson = ' The return json is ' . json_encode($exJson);
} else {
$exJson = '';
}
throw new Aliyun_Log_Exception ( 'RequestError',
"Request is failed. Http code is $responseCode.$exJson", $requestId );
}
}
}