Commit 16088d94 authored by mmn's avatar mmn

ErrorAction and InfoAction fixes, are now ManagedAction

parent bc0a903b
......@@ -64,27 +64,13 @@ class ClientErrorAction extends ErrorAction
{
parent::__construct($message, $code);
$this->default = 400;
}
// XXX: Should these error actions even be invokable via URI?
protected function handle()
{
parent::handle();
$this->code = $this->trimmed('code');
if (!$this->code || $code < 400 || $code > 499) {
if (!$this->code || $this->code < 400 || $this->code > 499) {
$this->code = $this->default;
}
$this->message = $this->trimmed('message');
if (!$this->message) {
$this->message = "Client Error $this->code";
}
$this->showPage();
}
/**
......
......@@ -44,7 +44,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @see ErrorAction
*/
class InfoAction extends Action
class InfoAction extends ManagedAction
{
var $message = null;
......
......@@ -64,32 +64,21 @@ class ServerErrorAction extends ErrorAction
$this->default = 500;
// Server errors must be logged.
$log = "ServerErrorAction: $code $message";
if ($ex) {
$log .= "\n" . $ex->getTraceAsString();
}
common_log(LOG_ERR, $log);
}
// XXX: Should these error actions even be invokable via URI?
protected function handle()
{
parent::handle();
$this->code = $this->trimmed('code');
if (!$this->code || $code < 500 || $code > 599) {
if (!$this->code || $this->code < 500 || $this->code > 599) {
$this->code = $this->default;
}
$this->message = $this->trimmed('message');
if (!$this->message) {
$this->message = "Server Error $this->code";
}
// Server errors must be logged.
$log = "ServerErrorAction: $code $message";
if ($ex) {
$log .= "\n" . $ex->getTraceAsString();
}
common_log(LOG_ERR, $log);
$this->showPage();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment