Consistant error for groups that dont exist in API

This commit is contained in:
Eric Helgeson 2009-11-16 14:59:32 -05:00
parent b7a08fdacc
commit e14c88f6c5
6 changed files with 16 additions and 5 deletions

View File

@ -92,7 +92,7 @@ class ApiGroupIsMemberAction extends ApiBareAuthAction
} }
if (empty($this->group)) { if (empty($this->group)) {
$this->clientError('Group not found!', 404, $this->format); $this->clientError(_('Group not found!'), 404, $this->format);
return false; return false;
} }

View File

@ -101,7 +101,7 @@ class ApiGroupJoinAction extends ApiAuthAction
} }
if (empty($this->group)) { if (empty($this->group)) {
$this->clientError('Group not found!', 404, $this->format); $this->clientError(_('Group not found!'), 404, $this->format);
return false; return false;
} }

View File

@ -101,7 +101,7 @@ class ApiGroupLeaveAction extends ApiAuthAction
} }
if (empty($this->group)) { if (empty($this->group)) {
$this->clientError('Group not found!', 404, $this->format); $this->clientError(_('Group not found!'), 404, $this->format);
return false; return false;
} }

View File

@ -87,6 +87,11 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction
{ {
parent::handle($args); parent::handle($args);
if (empty($this->group)) {
$this->clientError(_('Group not found!'), 404, $this->format);
return false;
}
// XXX: RSS and Atom // XXX: RSS and Atom
switch($this->format) { switch($this->format) {

View File

@ -87,7 +87,7 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
if (empty($this->group)) { if (empty($this->group)) {
$this->clientError( $this->clientError(
'Group not found!', _('Group not found!'),
404, 404,
$this->format $this->format
); );

View File

@ -69,7 +69,6 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction
parent::prepare($args); parent::prepare($args);
$this->group = $this->getTargetGroup($this->arg('id')); $this->group = $this->getTargetGroup($this->arg('id'));
$this->notices = $this->getNotices();
return true; return true;
} }
@ -87,6 +86,13 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction
function handle($args) function handle($args)
{ {
parent::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(); $this->showTimeline();
} }