if (ids_count > 0) {
for (int i = 0; i < ids_count; i++) {
- bp_bookmark_adaptor_get_easy_all(ids[i], &info);
+ if (bp_bookmark_adaptor_get_easy_all(ids[i], &info) < 0) {
+ int errorcode = bp_bookmark_adaptor_get_errorcode();
+ LoggerW("bp_bookmark_adaptor_get_easy_all for id %d returns error: %d", ids[i], errorcode);
+ continue;
+ }
item.id = ids[i];
item.bookmark_info = info;
if ((ctx.shouldGetItems && item.bookmark_info.parent != ctx.id) ||
using namespace common;
-CalendarManager::CalendarManager() {
+CalendarManager::CalendarManager() : is_connected_(false) {
ScopeLogger();
if (CALENDAR_ERROR_NONE == calendar_connect()) {
LoggerD("Calendar DB connected");
single_obj["readOnly"] = JsonValue(CONTACTS_ADDRESS_BOOK_MODE_READONLY == mode);
out.push_back(single);
- contacts_list_next(*contacts_list_ptr);
+ error_code = contacts_list_next(*contacts_list_ptr);
+ if (CONTACTS_ERROR_NONE != error_code) {
+ LoggerW("contacts_list_next() failed: %d, ignoring remaining contacts", error_code);
+ break;
+ }
}
return PlatformResult(ErrorCode::NO_ERROR);
out.push_back(JsonValue(obj));
- contacts_list_next(person_list);
+ error_code = contacts_list_next(person_list);
+ if (CONTACTS_ERROR_NONE != error_code) {
+ LoggerW("contacts_list_next() failed: %d, ignoring remaining contacts", error_code);
+ break;
+ }
}
return PlatformResult(ErrorCode::NO_ERROR);
out.push_back(JsonValue(obj));
- contacts_list_next(person_list);
+ error_code = contacts_list_next(person_list);
+ if (CONTACTS_ERROR_NONE != error_code) {
+ LoggerW("contacts_list_next() failed: %d, ignoring remaining contacts", error_code);
+ break;
+ }
}
return PlatformResult(ErrorCode::NO_ERROR);
usage_count += usage_count_tmp;
- contacts_list_next(list);
+ ret = contacts_list_next(list);
+ if (CONTACTS_ERROR_NONE != ret) {
+ LoggerW("contacts_list_next() failed: %d, ignoring remaining contacts", ret);
+ break;
+ }
}
out.insert(
}
metadata_extractor_h extractor;
- metadata_extractor_create(&extractor);
+ ret = metadata_extractor_create(&extractor);
+ if (METADATA_EXTRACTOR_ERROR_NONE != ret) {
+ LOGGER(ERROR) << "metadata_extractor_create failed, error: " << ret;
+ }
std::unique_ptr<std::remove_pointer<metadata_extractor_h>::type, int (*)(metadata_extractor_h)>
extractor_ptr(extractor, &metadata_extractor_destroy); // automatically release the memory
result = job(handle, &info->requestId);
RETURN_IF_FAIL(result, "Doing job failed with error");
- IdMap[info->requestId] = info.get();
-
- info.release();
+ IdMap[info->requestId] = info.release();
return result;
}
result = job(handle, &info->requestId);
RETURN_IF_FAIL(result, "Doing job failed with error");
- IdMap[info->requestId] = info.get();
-
- info.release();
+ IdMap[info->requestId] = info.release();
return result;
}
LoggerE("Cannot get realpath of %s. Error: %s!", path.c_str(),
GetErrorString(tmpErrno).c_str());
error_cb(FilesystemError::Other);
+ return;
}
std::string canonicalPathStr(canonicalPath);
if (head->alias) {
char* saveptr = nullptr;
char* tokenized = strtok_r(head->alias, kSpace.c_str(), &saveptr);
- obj["packageId"] = picojson::value(tokenized);
+ if (nullptr != tokenized) {
+ obj["packageId"] = picojson::value(tokenized);
+ }
tokenized = strtok_r(nullptr, kSpace.c_str(), &saveptr);
- obj["name"] = picojson::value(tokenized);
+ if (nullptr != tokenized) {
+ obj["name"] = picojson::value(tokenized);
+ }
aliases.push_back(resultElem);
}