Bookmark plugin: graceful error out for failure to import a delicious bookmark due to it being already bookmarked

This commit is contained in:
Brion Vibber 2010-12-31 12:09:15 -08:00
parent 5dfc9e1b18
commit 5687531848

View File

@ -96,13 +96,19 @@ class DeliciousBookmarkImporter extends QueueHandler
$addDate = $a->getAttribute('add_date'); $addDate = $a->getAttribute('add_date');
$created = common_sql_date(intval($addDate)); $created = common_sql_date(intval($addDate));
$saved = Bookmark::saveNew($user->getProfile(), try {
$title, $saved = Bookmark::saveNew($user->getProfile(),
$url, $title,
$tags, $url,
$description, $tags,
array('created' => $created, $description,
'distribute' => false)); array('created' => $created,
'distribute' => false));
} catch (ClientException $e) {
// Most likely a duplicate -- continue on with the rest!
common_log(LOG_ERR, "Error importing delicious bookmark to $url: " . $e->getMessage());
return true;
}
return true; return true;
} }