Commit 56875318 authored by Brion Vibber's avatar Brion Vibber

Bookmark plugin: graceful error out for failure to import a delicious bookmark...

Bookmark plugin: graceful error out for failure to import a delicious bookmark due to it being already bookmarked
parent 5dfc9e1b
......@@ -96,13 +96,19 @@ class DeliciousBookmarkImporter extends QueueHandler
$addDate = $a->getAttribute('add_date');
$created = common_sql_date(intval($addDate));
$saved = Bookmark::saveNew($user->getProfile(),
$title,
$url,
$tags,
$description,
array('created' => $created,
'distribute' => false));
try {
$saved = Bookmark::saveNew($user->getProfile(),
$title,
$url,
$tags,
$description,
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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment