https://bugs.kde.org/show_bug.cgi?id=252178
Tobias Koenig <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #3 from Tobias Koenig <tokoe kde org> 2010-12-30 13:34:30 --- commit aa74751de1b4466f6779ce9e865b801893d7de5c branch master Author: Tobias Koenig <[email protected]> Date: Thu Dec 30 13:34:04 2010 +0100 Propagate errors from ItemRetriever to FETCH handler Errors from the ItemRetriever (e.g. calling requestItemDelivery on a resource in offline mode) will be propagated to the FETCH handler now, so that the caller of ItemFetchJob can show an error message to the user. BUG:252178 diff --git a/server/src/handler/fetchhelper.cpp b/server/src/handler/fetchhelper.cpp index 88edf74..d66824f 100644 --- a/server/src/handler/fetchhelper.cpp +++ b/server/src/handler/fetchhelper.cpp @@ -224,7 +224,9 @@ bool FetchHelper::parseStream( const QByteArray &responseIdentifier ) retriever.setScope( mScope ); retriever.setRetrieveParts( payloadList ); retriever.setRetrieveFullPayload( mFullPayload ); - retriever.exec(); // There we go, retrieve the missing parts from the resource. + if ( !retriever.exec() ) { // There we go, retrieve the missing parts from the resource. + throw HandlerException( "Unable to fetch item from backend" ); + } } QSqlQuery itemQuery = buildItemQuery(); diff --git a/server/src/storage/itemretriever.cpp b/server/src/storage/itemretriever.cpp index 6d5a030..9c84a07 100644 --- a/server/src/storage/itemretriever.cpp +++ b/server/src/storage/itemretriever.cpp @@ -169,10 +169,10 @@ QSqlQuery ItemRetriever::buildQuery() const } -void ItemRetriever::exec() +bool ItemRetriever::exec() { if ( mParts.isEmpty() && !mFullPayload ) - return; + return true; QSqlQuery query = buildQuery(); ItemRetrievalRequest* lastRequest = 0; @@ -234,6 +234,7 @@ void ItemRetriever::exec() ItemRetrievalManager::instance()->requestItemDelivery( request ); } catch ( const ItemRetrieverException &e ) { akError() << e.type() << ": " << e.what(); + return false; } } @@ -247,6 +248,8 @@ void ItemRetriever::exec() retriever.exec(); } } + + return true; } QString ItemRetriever::driverName() diff --git a/server/src/storage/itemretriever.h b/server/src/storage/itemretriever.h index aeb650b..866d265 100644 --- a/server/src/storage/itemretriever.h +++ b/server/src/storage/itemretriever.h @@ -62,7 +62,7 @@ class ItemRetriever void setScope( const Scope &scope ); Scope scope() const; - void exec(); + bool exec(); private: /** Convenience method which returns the database driver name */ -- Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. _______________________________________________ Kdepim-bugs mailing list [email protected] https://mail.kde.org/mailman/listinfo/kdepim-bugs
