]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Bookmark/deliciousbookmarkimporter.php
More info for a proper, fancy-url lighttpd setup
[quix0rs-gnu-social.git] / plugins / Bookmark / deliciousbookmarkimporter.php
index 96fe621c2f7f28dcb4d1a2b31e073dc60200bec5..eca9e96060549d8d807cfdf121cb284c4c68d654 100644 (file)
@@ -65,7 +65,7 @@ class DeliciousBookmarkImporter extends QueueHandler
      */
     function handle($data)
     {
-        $profile = Profile::staticGet('id', $data['profile_id']);
+        $profile = Profile::getKV('id', $data['profile_id']);
 
         try {
             $saved = Bookmark::saveNew($profile,
@@ -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;