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