Catch echonest errors properly
This commit is contained in:
parent
fbb62a2f43
commit
81fb559f66
|
@ -32,8 +32,8 @@ void Echonest::Parser::checkForErrors( QNetworkReply* reply ) throw( Echonest::P
|
|||
// throw ParseError( Echonest::UnfinishedQuery );
|
||||
//
|
||||
if( reply->error() != QNetworkReply::NoError ) {
|
||||
ParseError* err = new ParseError( Echonest::NetworkError );
|
||||
err->setNetworkError( reply->error() );
|
||||
ParseError err( Echonest::NetworkError );
|
||||
err.setNetworkError( reply->error() );
|
||||
|
||||
throw err;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,12 @@ EchoNestArtistInfo::RequestPtr EchoNestArtistInfo::ReplyFinished(QNetworkReply*
|
|||
|
||||
foreach (RequestPtr request, requests_) {
|
||||
if (request->pending_replies_.contains(reply)) {
|
||||
request->artist_->parseProfile(reply);
|
||||
try {
|
||||
request->artist_->parseProfile(reply);
|
||||
} catch (Echonest::ParseError e) {
|
||||
qWarning() << "Error parsing echonest reply:" << e.errorType() << e.what();
|
||||
}
|
||||
|
||||
request->pending_replies_.removeAll(reply);
|
||||
|
||||
if (request->pending_replies_.isEmpty()) {
|
||||
|
|
Loading…
Reference in New Issue