Revision 1808
Added by Dietmar almost 12 years ago
globalExceptionHandler.php | ||
---|---|---|
6 | 6 |
* @copyright WebsiteBaker.org e.V. |
7 | 7 |
* @link http://websitebaker2.org |
8 | 8 |
* @license http://www.gnu.org/licenses/gpl.html |
9 |
* @version $Id: class.order.php 1487 2011-08-10 13:20:15Z DarkViper $
|
|
10 |
* @filesource $HeadURL: http://svn.websitebaker2.org/branches/2.8.x/wb/framework/class.order.php $
|
|
9 |
* @version $Id$ |
|
10 |
* @filesource $HeadURL$ |
|
11 | 11 |
* |
12 | 12 |
* Global exception-handler |
13 | 13 |
* This module will activate a global exception handler to catch all thrown exceptions |
... | ... | |
17 | 17 |
* define several default exceptions directly to prevent from extra loading requests |
18 | 18 |
*/ |
19 | 19 |
/** |
20 |
*
|
|
20 |
* |
|
21 | 21 |
*/ |
22 | 22 |
class AppException extends Exception{ |
23 | 23 |
public function __toString() { |
... | ... | |
53 | 53 |
return $out; |
54 | 54 |
} |
55 | 55 |
} // end of class |
56 |
/** |
|
57 |
* define Exception to show error message |
|
58 |
*/ |
|
59 |
class ErrorMsgException extends Exception { |
|
60 |
public function __toString() { |
|
61 |
$out = $this->getMessage(); |
|
62 |
return $out; |
|
63 |
} |
|
64 |
} // end of class |
|
56 | 65 |
|
57 | 66 |
/* -- several security exceptions ----------------------------------------------------- */ |
58 | 67 |
class SecurityException extends RuntimeException { } |
... | ... | |
88 | 97 |
$sResponse = $_SERVER['SERVER_PROTOCOL'].' 403 Forbidden'; |
89 | 98 |
header($sResponse); |
90 | 99 |
echo $e; |
100 |
}elseif($e instanceof ErrorMsgException) { |
|
101 |
echo (string)$e; |
|
91 | 102 |
}elseif($e instanceof RuntimeException) { |
92 | 103 |
$out = 'There was a serious runtime error:'."\n"; |
93 | 104 |
$out .= $e->getMessage()."\n"; |
94 | 105 |
Also available in: Unified diff
! add ErrorMsgException in /framework/globalExceptionHandler.php
! ErrorMessage "ADMIN_INSUFFICIENT_PRIVELLIGES" now can be styled
by the /admin/skel/themes/htt/ErrorMsgFile.htt template
! add css selectors to wb_theme