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); }
protected function parseResponse(HttpResponse $response, $options) { return OSSResponseParserFactory::factory()->createParser($this->getName())->parse($response, $options); }