From f5af67ce68e827d26d24d07fd02a51aff6aef633 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 17 Jun 2012 09:52:35 -0400 Subject: [PATCH] Skip on already-exists error --- plugins/Bookmark/deliciousbookmarkimporter.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/Bookmark/deliciousbookmarkimporter.php b/plugins/Bookmark/deliciousbookmarkimporter.php index 96fe621c2f..4065fc3085 100644 --- a/plugins/Bookmark/deliciousbookmarkimporter.php +++ b/plugins/Bookmark/deliciousbookmarkimporter.php @@ -75,10 +75,17 @@ class DeliciousBookmarkImporter extends QueueHandler $data['description'], array('created' => $data['created'], 'distribute' => false)); - } catch (ClientException $e) { + } catch (ClientException $ce) { // Most likely a duplicate -- continue on with the rest! - common_log(LOG_ERR, "Error importing delicious bookmark to $data[url]: " . $e->getMessage()); + common_log(LOG_ERR, "Error importing delicious bookmark to $data[url]: " . $ce->getMessage()); return true; + } catch (Exception $ex) { + if (preg_match("/DB Error: already exists/", $ex->getMessage())) { + common_log(LOG_ERR, "Error importing delicious bookmark to $data[url]: " . $ce->getMessage()); + return true; + } else { + throw $ex; + } } return true; -- 2.39.5