Skip to content

Commit

Permalink
Audioscrobbler - update for latest Zend_Http
Browse files Browse the repository at this point in the history
  • Loading branch information
sasezaki committed Mar 2, 2012
1 parent db3e13d commit a47cc9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/Zend/Service/Audioscrobbler/Audioscrobbler.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ protected function _getInfo($service, $params = null)
$this->getHttpClient()->setUri("http://ws.audioscrobbler.com{$service}?{$params}");
}

$response = $this->getHttpClient()->request();
$response = $this->getHttpClient()->send();
$responseBody = $response->getBody();

if (preg_match('/No such path/', $responseBody)) {
throw new Exception\RuntimeException('Could not find: ' . $this->getHttpClient()->getUri());
} elseif (preg_match('/No user exists with this name/', $responseBody)) {
throw new Exception\RuntimeException('No user exists with this name');
} elseif (!$response->isSuccessful()) {
throw new Exception\RuntimeException('The web service ' . $this->getHttpClient()->getUri() . ' returned the following status code: ' . $response->getStatus());
} elseif (!$response->isSuccess()) {
throw new Exception\RuntimeException('The web service ' . $this->getHttpClient()->getUri() . ' returned the following status code: ' . $response->getStatusCode());
}

set_error_handler(array($this, '_errorHandler'));
Expand Down

0 comments on commit a47cc9b

Please sign in to comment.