]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Consistant error for groups that dont exist in API
authorEric Helgeson <erichelgeson@gmail.com>
Mon, 16 Nov 2009 19:59:32 +0000 (14:59 -0500)
committerEric Helgeson <erichelgeson@gmail.com>
Mon, 16 Nov 2009 20:00:36 +0000 (15:00 -0500)
actions/apigroupismember.php
actions/apigroupjoin.php
actions/apigroupleave.php
actions/apigroupmembership.php
actions/apigroupshow.php
actions/apitimelinegroup.php

index a822d18dddc64fce890cd09c54d0e8af9e6ad9de..08348e97bd4306bc0e745243355a12783f865f85 100644 (file)
@@ -92,7 +92,7 @@ class ApiGroupIsMemberAction extends ApiBareAuthAction
         }
 
         if (empty($this->group)) {
-            $this->clientError('Group not found!', 404, $this->format);
+            $this->clientError(_('Group not found!'), 404, $this->format);
             return false;
         }
 
index ffda3986ff0808e9de6d15df72f391aea8dad471..b531d95015a8fd19af7cdb02303da407f75c1e23 100644 (file)
@@ -101,7 +101,7 @@ class ApiGroupJoinAction extends ApiAuthAction
         }
 
         if (empty($this->group)) {
-            $this->clientError('Group not found!', 404, $this->format);
+            $this->clientError(_('Group not found!'), 404, $this->format);
             return false;
         }
 
index 8665ea1aa81f28b45cb39b28e059067321dda080..514a3a557da4e923dbe419e9cf150607c92cbfe2 100644 (file)
@@ -101,7 +101,7 @@ class ApiGroupLeaveAction extends ApiAuthAction
         }
 
         if (empty($this->group)) {
-            $this->clientError('Group not found!', 404, $this->format);
+            $this->clientError(_('Group not found!'), 404, $this->format);
             return false;
         }
 
index d221a64183473c086f9c14ede6a35fe122a905af..dd2843161ac13668db300a9ce00cd6a1b3b2f8e6 100644 (file)
@@ -87,6 +87,11 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction
     {
         parent::handle($args);
 
+        if (empty($this->group)) {
+            $this->clientError(_('Group not found!'), 404, $this->format);
+            return false;
+        }
+
         // XXX: RSS and Atom
 
         switch($this->format) {
index b745ff92f6aff0223f63115b4141d3ff9b78a307..f9b960747b2336baaeb8bb06c778d03b386eeeb2 100644 (file)
@@ -87,7 +87,7 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
 
         if (empty($this->group)) {
             $this->clientError(
-                'Group not found!',
+                _('Group not found!'),
                 404,
                 $this->format
             );
index f25f6ba513d76b6ad85aa129be18dc3f4ffaabfb..de13e7eb9871b95c3ed5d90b869aa236db08e200 100644 (file)
@@ -69,7 +69,6 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction
         parent::prepare($args);
 
         $this->group   = $this->getTargetGroup($this->arg('id'));
-        $this->notices = $this->getNotices();
 
         return true;
     }
@@ -87,6 +86,13 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction
     function handle($args)
     {
         parent::handle($args);
+
+        if (empty($this->group)) {
+            $this->clientError(_('Group not found!'), 404, $this->format);
+            return false;
+        }
+
+        $this->notices = $this->getNotices();
         $this->showTimeline();
     }