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: * Constructor to create an instance of this class.
25: *
26: * @param string $message
27: * The Exception message to throw.
28: * @param int $code [optional]
29: * The Exception code.
30: * @param Exception $previous [optional]
31: * The previous exception used for the exception chaining.
32: *
33: * @throws cInvalidArgumentException
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: