Summary: | No error message when trying to display emails while 'Enable Disconnected Mode' unchecked | ||
---|---|---|---|
Product: | [Unmaintained] KMail Mobile | Reporter: | Sabine Faure <sabine> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | CLOSED FIXED | ||
Severity: | normal | CC: | kde, tokoe, vkrause |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Patch to fix error propagation in Akonadi server |
Description
Sabine Faure
2010-09-23 22:45:21 UTC
Hej Sabine, I have changed the message viewer already to show status information if some error condition happens. Attached is a patch which forwards the item retrieval errors (caused when calling requestItemDelivery on the IMAP resource in offline-mode) to the Akonadi::ItemFetchJob object, which itself will show the error as status information in the message viewer. @Volker is the patch Ok to commit or do you see any unwanted side effects, since the complete ItemFetchJob fails now whenever requestItemDelivery fails? Created attachment 55347 [details]
Patch to fix error propagation in Akonadi server
Patch that forwards errors of requestItemDelivery() to the FETCH handler
commit aa74751de1b4466f6779ce9e865b801893d7de5c branch master Author: Tobias Koenig <tokoe@kde.org> 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 */ Hi Tobias! Indeed it is corrected now. First a 'The KDE email client' message appears on a white background as well as 'Loading message...' After about 20s a 'Message loading failed: Unable to fetch item from backend' message appears indicating to the user that something wrong has happened while loading. Hopefully, that will give her a clue to check her wifi connexion so I am closing this bug. N900, 4:4.6~.20110106.1209.gitfde48d5-1maemo1.121147 |