コード例 #1
0
ファイル: GetObjectCommand.php プロジェクト: a07061625/upload
 public function handle(HttpResponse $response)
 {
     if ($response->getStatusCode() == 404) {
         $response->close();
         throw OSSExceptionFactory::factory()->create(OSSErrorCode::NO_SUCH_KEY, ResourceManager::getInstance()->getString('NoSuchKey'), $response->getHeader(OSSHeaders::OSS_HEADER_REQUEST_ID));
     }
 }
コード例 #2
0
 public function handle(HttpResponse $response)
 {
     if ($response->isSuccess()) {
         return;
     }
     if (!$response->getContent() || $response->getContentLength() <= 0) {
         throw OSSExceptionFactory::factory()->createInvalidResponseException('ServerReturnsUnknownError');
     }
     $error = OSSResponseParserFactory::factory()->createErrorParser()->parse($response, null);
     throw OSSExceptionFactory::factory()->createFromError($error);
 }