1 | <?php |
||
12 | class JsonErrorHandler { |
||
13 | /** |
||
14 | * @var IHttpApp |
||
15 | */ |
||
16 | protected $httpApp; |
||
17 | |||
18 | /** |
||
19 | * @var IErrorHandler |
||
20 | */ |
||
21 | protected $errorHandler; |
||
22 | |||
23 | /** |
||
24 | * JsonErrorHandler constructor. |
||
25 | * |
||
26 | * @param IHttpApp $httpApp |
||
27 | * @param IErrorHandler $errorHandler |
||
28 | */ |
||
29 | public function __construct(IHttpApp $httpApp, IErrorHandler $errorHandler) { |
||
33 | |||
34 | /** |
||
35 | * @return IHttpApp |
||
36 | */ |
||
37 | public function getHttpApp() { |
||
40 | |||
41 | /** |
||
42 | * @param IHttpApp $httpApp |
||
43 | */ |
||
44 | public function setHttpApp(IHttpApp $httpApp) { |
||
47 | |||
48 | /** |
||
49 | * @return IErrorHandler |
||
50 | */ |
||
51 | public function getErrorHandler() { |
||
54 | |||
55 | /** |
||
56 | * @param IErrorHandler $errorHandler |
||
57 | */ |
||
58 | public function setErrorHandler(IErrorHandler $errorHandler) { |
||
61 | |||
62 | /** |
||
63 | * Enable error handling. |
||
64 | */ |
||
65 | public function enableErrorHandling() { |
||
68 | |||
69 | /** |
||
70 | * Enable exception handling. |
||
71 | */ |
||
72 | public function enableExceptionHandling() { |
||
75 | |||
76 | /** |
||
77 | * @param IError $error |
||
78 | */ |
||
79 | public function handleError(IError $error) { |
||
88 | |||
89 | /** |
||
90 | * @param Exception $ex |
||
91 | */ |
||
92 | public function handleException(Exception $ex) { |
||
112 | } |
||
113 |