]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Favorite/lib/favcommand.php
Found some unreachable code in Favorite
[quix0rs-gnu-social.git] / plugins / Favorite / lib / favcommand.php
index 94658b8a53390e7173294977ecd0faa25943bd4e..d89b7f34217a4a576646a08af68e3af739452c28 100644 (file)
@@ -25,13 +25,12 @@ class FavCommand extends Command
             return; 
         } 
  
-        $fave = Fave::addNew($this->user->getProfile(), $notice); 
-        if (!$fave) { 
-            // TRANS: Error message text shown when a favorite could not be set. 
-            $channel->error($this->user, _('Could not create favorite.')); 
-            return; 
-        } 
+        try {
+            $fave = Fave::addNew($this->user->getProfile(), $notice); 
+        } catch (Exception $e) {
+            $channel->error($this->user, $e->getMessage());
+            return;
+        }
  
         // @fixme favorite notification should be triggered 
         // at a lower level