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);
 }
Пример #2
0
 protected function parseResponse(HttpResponse $response, $options)
 {
     return OSSResponseParserFactory::factory()->createParser($this->getName())->parse($response, $options);
 }