Akonadi: handle 404 in readItem()
readItem() might be asked to retrieve a non-existent item. The fetch job succeeds in that case, but without returning any item. Throw the 404 status error in this case.
This commit is contained in:
parent
4928d51eca
commit
f2cb364e23
|
@ -225,6 +225,9 @@ void AkonadiSyncSource::readItem(const std::string &luid, std::string &data, boo
|
|||
ItemFetchJob *fetchJob = new ItemFetchJob(Item(syncItemId));
|
||||
fetchJob->fetchScope().fetchFullPayload();
|
||||
if (fetchJob->exec()) {
|
||||
if (fetchJob->items().empty()) {
|
||||
throwError(STATUS_NOT_FOUND, string("extracting item ") + luid);
|
||||
}
|
||||
QByteArray payload = fetchJob->items().first().payloadData();
|
||||
data.assign(payload.constData(),
|
||||
payload.size());
|
||||
|
|
Loading…
Reference in New Issue