Bin will be removed on June 1, 2014 in favor of http://gist.github.com. Please save all your pastes before then. So long, and thanks for all the fish!×
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?php
 
App::uses('ExceptionRenderer', 'Error');
 
class AppExceptionRenderer extends ExceptionRenderer {
 
    /*-------------------------------------------------------------------------------------------------------------------------------------------*/
    /* -- Exceptions
    /*-------------------------------------------------------------------------------------------------------------------------------------------*/
   
    public function notFound($error) {
        $this->controller->beforeFilter();
        $this->controller->set('title_for_layout', 'Not Found');
        $this->controller->render('/Errors/error404');
        $this->controller->response->send();
    }
    public function badRequest($error) {
        $this->controller->beforeFilter();
        $this->controller->set('title_for_layout', 'Not Found');
        $this->controller->render('/Errors/error400');
        $this->controller->response->send();
    }
    public function forbidden($error) {
        $this->controller->beforeFilter();
        $this->controller->set('title_for_layout', 'Not Found');
        $this->controller->render('/Errors/error403');
        $this->controller->response->send();
    }
    public function methodNotAllowed($error) {
        $this->controller->beforeFilter();
        $this->controller->set('title_for_layout', 'Not Found');
        $this->controller->render('/Errors/error405');
        $this->controller->response->send();
    }
    public function internalError($error) {
        $this->controller->beforeFilter();
        $this->controller->set('title_for_layout', 'Not Found');
        $this->controller->render('/Errors/error500');
        $this->controller->response->send();
    }
    public function notImplemented($error) {
        $this->controller->beforeFilter();
        $this->controller->set('title_for_layout', 'Not Found');
        $this->controller->render('/Errors/error501');
        $this->controller->response->send();
    }
   
    /*-------------------------------------------------------------------------------------------------------------------------------------------*/
    /* -- Other
    /*-------------------------------------------------------------------------------------------------------------------------------------------*/
   
    public function missingController($error) {
        $this->notFound($error);
    }
    public function missingAction($error) {
        $this->notFound($error);
    }
    public function missingView($error) {
        $this->notFound($error);
    }
    public function missingLayout($error) {
        $this->internalError($error);
    }
    public function missingHelper($error) {
        $this->internalError($error);
    }
    public function missingBehavior($error) {
        $this->internalError($error);
    }
    public function missingComponent($error) {
        $this->internalError($error);
    }
    public function missingTask($error) {
        $this->internalError($error);
    }
    public function missingShell($error) {
        $this->internalError($error);
    }
    public function missingShellMethod($error) {
        $this->internalError($error);
    }
    public function missingDatabase($error) {
        $this->internalError($error);
    }
    public function missingConnection($error) {
        $this->internalError($error);
    }
    public function missingTable($error) {
        $this->internalError($error);
    }
    public function missingAction($error) {
        $this->internalError($error);
    }
    public function privateAction($error) {
        $this->internalError($error);
    }
   
    /*-------------------------------------------------------------------------------------------------------------------------------------------*/
    /*-------------------------------------------------------------------------------------------------------------------------------------------*/
}
 
?>