forked from GNUsocial/gnu-social
Bookmark plugin: graceful error out for failure to import a delicious bookmark due to it being already bookmarked
This commit is contained in:
parent
5dfc9e1b18
commit
5687531848
@ -96,6 +96,7 @@ 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));
|
||||||
|
|
||||||
|
try {
|
||||||
$saved = Bookmark::saveNew($user->getProfile(),
|
$saved = Bookmark::saveNew($user->getProfile(),
|
||||||
$title,
|
$title,
|
||||||
$url,
|
$url,
|
||||||
@ -103,6 +104,11 @@ class DeliciousBookmarkImporter extends QueueHandler
|
|||||||
$description,
|
$description,
|
||||||
array('created' => $created,
|
array('created' => $created,
|
||||||
'distribute' => false));
|
'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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user