1 <?php
 2 
 3 /**
 4  * @package redaxo\core
 5  */
 6 class rex_exception extends Exception
 7 {
 8     /**
 9      * @param string    $message
10      * @param Exception $previous
11      */
12     public function __construct($message, Exception $previous = null)
13     {
14         parent::__construct($message, 0, $previous);
15     }
16 }
17 
18 /**
19  * @package redaxo\core
20  */
21 class rex_sql_exception extends rex_exception
22 {
23     private $sql;
24 
25     public function __construct($message, Exception $previous = null, rex_sql $sql = null)
26     {
27         parent::__construct($message, $previous);
28 
29         $this->sql = $sql;
30     }
31 
32     /**
33      * @return null|rex_sql
34      */
35     public function getSql()
36     {
37         return $this->sql;
38     }
39 }
40 
41 /**
42  * Exception class for user-friendly error messages.
43  *
44  * @package redaxo\core
45  */
46 class rex_functional_exception extends rex_exception
47 {
48 }
49 
50 /**
51  * Exception class for http-status code handling.
52  *
53  * @package redaxo\core
54  */
55 class rex_http_exception extends rex_exception
56 {
57     private $httpCode;
58 
59     /**
60      * @param Exception $cause
61      * @param int       $httpCode
62      */
63     public function __construct(Exception $cause, $httpCode)
64     {
65         parent::__construct($cause->getMessage(), $cause);
66         $this->httpCode = $httpCode;
67     }
68 
69     /**
70      * @return int
71      */
72     public function getHttpCode()
73     {
74         return $this->httpCode;
75     }
76 }
77 
78 /**
79  * Exception class for yaml parse errors.
80  *
81  * @package redaxo\core
82  */
83 class rex_yaml_parse_exception extends rex_exception
84 {
85 }
86