1: <?php
2:
3: /**
4: * This file contains the cErrorException class.
5: *
6: * @package Core
7: * @subpackage Exception
8: * @version SVN Revision $Rev:$
9: *
10: * @author Simon Sprankel
11: * @copyright four for business AG <www.4fb.de>
12: * @license http://www.contenido.org/license/LIZENZ.txt
13: * @link http://www.4fb.de
14: * @link http://www.contenido.org
15: */
16:
17: /**
18: * An Error Exception.
19: * You should use this CONTENIDO exception instead of the standard PHP
20: * {@link ErrorException}.
21: * This exception type is logged to data/logs/exception.txt.
22: */
23: class cErrorException extends cException {
24:
25: /**
26: * Constructs the Exception.
27: *
28: * @param string $message
29: * The Exception message to throw.
30: * @param int $code [optional]
31: * The Exception code.
32: * @param Exception $previous [optional]
33: * The previous exception used for the exception chaining.
34: */
35: public function __construct($message, $code = 0, Exception $previous = NULL) {
36: $cfg = cRegistry::getConfig();
37:
38: // determine if exception should be logged
39: if (false === isset($cfg['debug']['log_error_exceptions'])) {
40: $this->_log_exception = true;
41: }
42:
43: if (false === $this->_log_exception) {
44: $this->_log_exception = $cfg['debug']['log_error_exceptions'];
45: }
46:
47: parent::__construct($message, $code, $previous);
48:
49: }
50:
51: }
52: