$this->show_json_timeline($notice);
break;
default:
- common_user_error(_('API method not found!'), $code = 404);
+ $this->clientError(_('API method not found!'), $code = 404);
break;
}
} else {
- common_server_error(_('Couldn\'t find any statuses.'), $code = 503);
+ $this->serverError(_('Couldn\'t find any statuses.'), $code = 503);
}
}
$this->show_json_timeline($notice);
break;
default:
- common_user_error(_('API method not found!'), $code = 404);
+ $this->clientError(_('API method not found!'), $code = 404);
}
}
$user = $this->get_user($apidata['api_arg'], $apidata);
if (!$user) {
- $this->client_error('Not Found', 404, $apidata['content-type']);
+ $this->clientError('Not Found', 404, $apidata['content-type']);
return;
}
$profile = $user->getProfile();
if (!$profile) {
- common_server_error(_('User has no profile.'));
+ $this->serverError(_('User has no profile.'));
return;
}
$this->show_json_timeline($notice);
break;
default:
- common_user_error(_('API method not found!'), $code = 404);
+ $this->clientError(_('API method not found!'), $code = 404);
}
}
parent::handle($args);
if (!in_array($apidata['content-type'], array('xml', 'json'))) {
- common_user_error(_('API method not found!'), $code = 404);
+ $this->clientError(_('API method not found!'), $code = 404);
return;
}
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
- $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']);
+ $this->clientError(_('This method requires a POST.'), 400, $apidata['content-type']);
return;
}
// as "truncated." Sending this error may screw up some clients
// that assume Twitter will truncate for them. Should we just
// truncate too? -- Zach
- $this->client_error(_('That\'s too long. Max notice size is 140 chars.'), $code = 406, $apidata['content-type']);
+ $this->clientError(_('That\'s too long. Max notice size is 140 chars.'), $code = 406, $apidata['content-type']);
return;
}
if ($reply) {
$reply_to = $in_reply_to_status_id;
} else {
- $this->client_error(_('Not found'), $code = 404, $apidata['content-type']);
+ $this->clientError(_('Not found'), $code = 404, $apidata['content-type']);
return;
}
}
$source, 1, $reply_to);
if (is_string($notice)) {
- $this->server_error($notice);
+ $this->serverError($notice);
return;
}
$this->show_json_timeline($notices);
break;
default:
- common_user_error(_('API method not found!'), $code = 404);
+ $this->clientError(_('API method not found!'), $code = 404);
}
}
parent::handle($args);
if (!in_array($apidata['content-type'], array('xml', 'json'))) {
- common_user_error(_('API method not found!'), $code = 404);
+ $this->clientError(_('API method not found!'), $code = 404);
return;
}
}
} else {
// XXX: Twitter just sets a 404 header and doens't bother to return an err msg
- $this->client_error(_('No status with that ID found.'), 404, $apidata['content-type']);
+ $this->clientError(_('No status with that ID found.'), 404, $apidata['content-type']);
}
}
parent::handle($args);
if (!in_array($apidata['content-type'], array('xml', 'json'))) {
- common_user_error(_('API method not found!'), $code = 404);
+ $this->clientError(_('API method not found!'), $code = 404);
return;
}
// Check for RESTfulness
if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) {
// XXX: Twitter just prints the err msg, no XML / JSON.
- $this->client_error(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']);
+ $this->clientError(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']);
return;
}
$notice = Notice::staticGet($notice_id);
if (!$notice) {
- $this->client_error(_('No status found with that ID.'), 404, $apidata['content-type']);
+ $this->clientError(_('No status found with that ID.'), 404, $apidata['content-type']);
return;
}
if ($user->id == $notice->profile_id) {
$replies = new Reply;
$replies->get('notice_id', $notice_id);
- common_dequeue_notice($notice);
$replies->delete();
$notice->delete();
$this->show_single_json_status($notice);
}
} else {
- $this->client_error(_('You may not delete another user\'s status.'), 403, $apidata['content-type']);
+ $this->clientError(_('You may not delete another user\'s status.'), 403, $apidata['content-type']);
}
}
$user = $this->get_user($apidata['api_arg'], $apidata);
if (!$user) {
- $this->client_error('Not Found', 404, $apidata['content-type']);
+ $this->clientError('Not Found', 404, $apidata['content-type']);
return;
}
$profile = $user->getProfile();
if (!$profile) {
- common_server_error(_('User has no profile.'));
+ $this->serverError(_('User has no profile.'));
return;
}
print json_encode($arrays);
break;
default:
- $this->client_error(_('unsupported file type'));
+ $this->clientError(_('unsupported file type'));
}
}
function featured($args, $apidata)
{
parent::handle($args);
- common_server_error(_('API method under construction.'), $code=501);
+ $this->serverError(_('API method under construction.'), $code=501);
}
function supported($cmd)