histogram: Make histograms crash less
[ninja.git] / application / controllers / error.php
blob3fcf70469e6a63300f8928639b71386506c79e0a
1 <?php defined('SYSPATH') OR die('No direct access allowed.');
2 /**
3 * Error controller.
4 * Show errors like 404 etc
6 * op5, and the op5 logo are trademarks, servicemarks, registered servicemarks
7 * or registered trademarks of op5 AB.
8 * All other trademarks, servicemarks, registered trademarks, and registered
9 * servicemarks mentioned herein may be the property of their respective owner(s).
10 * The information contained herein is provided AS IS with NO WARRANTY OF ANY
11 * KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY, AND FITNESS FOR A
12 * PARTICULAR PURPOSE.
14 class Error_Controller extends Ninja_Controller {
15 public function __construct()
17 try {
18 parent::__construct();
19 } catch (Exception $ex) {}
22 public function show_403() {
23 header('HTTP/1.1 403 Forbidden');
24 $this->template->content = $this->add_view('403');
25 $this->template->title = _('Forbidden');
28 public function show_404() {
29 header('HTTP/1.1 404 Not Found');
30 $this->template->content = $this->add_view('404');
31 $this->template->title = _('Page Not Found');
34 public function show_livestatus($exception) {
35 if (PHP_SAPI === 'cli') {
36 print("Livestatus error\n");
37 var_dump($exception);
38 return;
40 $this->template->content = $this->add_view('livestatus');
41 $this->template->title = _('Livestatus error');
42 if (!IN_PRODUCTION)
43 $this->template->content->exception = $exception;