10 * @author Evan Prodromou <evan@status.net>
11 * @author Zach Copley <zach@status.net>
12 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
13 * @link http://status.net/
15 * StatusNet - the distributed open-source microblogging tool
16 * Copyright (C) 2008, 2009, StatusNet, Inc.
18 * This program is free software: you can redistribute it and/or modify
19 * it under the terms of the GNU Affero General Public License as published by
20 * the Free Software Foundation, either version 3 of the License, or
21 * (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU Affero General Public License for more details.
28 * You should have received a copy of the GNU Affero General Public License
29 * along with this program. If not, see <http://www.gnu.org/licenses/>.
32 if (!defined('STATUSNET') && !defined('LACONICA')) {
36 require_once INSTALLDIR . '/lib/info.php';
39 * Base class for displaying HTTP errors
43 * @author Zach Copley <zach@status.net>
44 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
45 * @link http://status.net/
47 class ErrorAction extends InfoAction
49 static $status = array();
55 function __construct($message, $code, $output='php://output', $indent=null)
57 parent::__construct(null, $message, $output, $indent);
60 $this->message = $message;
61 $this->minimal = StatusNet::isApi();
63 // XXX: hack alert: usually we aren't going to
64 // call this page directly, but because it's
65 // an action it needs an args array anyway
66 $this->prepare($_REQUEST);
72 // Even more minimal -- we're in a machine API
73 // and don't want to flood the output.
74 $this->extraHeaders();
80 // We don't want to have any more output after this
89 function showContent()
91 $this->element('div', array('class' => 'error'), $this->message);