]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Skip on already-exists error
authorEvan Prodromou <evan@status.net>
Sun, 17 Jun 2012 13:52:35 +0000 (09:52 -0400)
committerEvan Prodromou <evan@status.net>
Sun, 17 Jun 2012 13:52:35 +0000 (09:52 -0400)
plugins/Bookmark/deliciousbookmarkimporter.php

index 96fe621c2f7f28dcb4d1a2b31e073dc60200bec5..4065fc308593ebc1d55330788d43799fd62e0350 100644 (file)
@@ -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;