Output XML and JSON error msgs for API calls

This commit is contained in:
Zach Copley 2009-06-17 14:32:36 -07:00
parent 2fbd141361
commit 7e25a7f3aa

View File

@ -545,7 +545,7 @@ class TwitterapiAction extends Action
$this->init_twitter_atom(); $this->init_twitter_atom();
break; break;
default: default:
$this->client_error(_('Not a supported data format.')); $this->clientError(_('Not a supported data format.'));
break; break;
} }
@ -573,13 +573,13 @@ class TwitterapiAction extends Action
$this->end_twitter_rss(); $this->end_twitter_rss();
break; break;
default: default:
$this->client_error(_('Not a supported data format.')); $this->clientError(_('Not a supported data format.'));
break; break;
} }
return; return;
} }
function client_error($msg, $code = 400, $content_type = 'json') function clientError($msg, $code = 400, $content_type = 'json')
{ {
static $status = array(400 => 'Bad Request', static $status = array(400 => 'Bad Request',
@ -666,7 +666,7 @@ class TwitterapiAction extends Action
$this->show_json_objects($profile_array); $this->show_json_objects($profile_array);
break; break;
default: default:
$this->client_error(_('Not a supported data format.')); $this->clientError(_('Not a supported data format.'));
return; return;
} }
return; return;