summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEric Helgeson <erichelgeson@gmail.com>2009-11-16 14:59:32 -0500
committerEric Helgeson <erichelgeson@gmail.com>2009-11-16 15:00:36 -0500
commite14c88f6c52fddeeb26c71f13e93db7a8fabdd3b (patch)
tree3c6a30a1aaa779d4419aacaf88d57ac4dd291cfb /actions
parentb7a08fdacc91c783b1e99f5dda2f3ce31ec8a6ee (diff)
Consistant error for groups that dont exist in API
Diffstat (limited to 'actions')
-rw-r--r--actions/apigroupismember.php2
-rw-r--r--actions/apigroupjoin.php2
-rw-r--r--actions/apigroupleave.php2
-rw-r--r--actions/apigroupmembership.php5
-rw-r--r--actions/apigroupshow.php2
-rw-r--r--actions/apitimelinegroup.php8
6 files changed, 16 insertions, 5 deletions
diff --git a/actions/apigroupismember.php b/actions/apigroupismember.php
index a822d18dd..08348e97b 100644
--- a/actions/apigroupismember.php
+++ b/actions/apigroupismember.php
@@ -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;
}
diff --git a/actions/apigroupjoin.php b/actions/apigroupjoin.php
index ffda3986f..b531d9501 100644
--- a/actions/apigroupjoin.php
+++ b/actions/apigroupjoin.php
@@ -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;
}
diff --git a/actions/apigroupleave.php b/actions/apigroupleave.php
index 8665ea1aa..514a3a557 100644
--- a/actions/apigroupleave.php
+++ b/actions/apigroupleave.php
@@ -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;
}
diff --git a/actions/apigroupmembership.php b/actions/apigroupmembership.php
index d221a6418..dd2843161 100644
--- a/actions/apigroupmembership.php
+++ b/actions/apigroupmembership.php
@@ -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) {
diff --git a/actions/apigroupshow.php b/actions/apigroupshow.php
index b745ff92f..f9b960747 100644
--- a/actions/apigroupshow.php
+++ b/actions/apigroupshow.php
@@ -87,7 +87,7 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
if (empty($this->group)) {
$this->clientError(
- 'Group not found!',
+ _('Group not found!'),
404,
$this->format
);
diff --git a/actions/apitimelinegroup.php b/actions/apitimelinegroup.php
index f25f6ba51..de13e7eb9 100644
--- a/actions/apitimelinegroup.php
+++ b/actions/apitimelinegroup.php
@@ -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();
}