Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
exception.php
1<?php
2namespace Bitrix\Main;
3
7class SystemException extends \Exception
8{
18 public function __construct($message = "", $code = 0, $file = "", $line = 0, \Exception $previous = null)
19 {
20 parent::__construct($message, $code, $previous);
21
22 if (!empty($file) && !empty($line))
23 {
24 $this->file = $file;
25 $this->line = $line;
26 }
27 }
28}
29
34{
35 protected $parameter;
36
37 public function __construct($message = "", $parameter = "", \Exception $previous = null)
38 {
39 parent::__construct($message, 100, '', 0, $previous);
40 $this->parameter = $parameter;
41 }
42
43 public function getParameter()
44 {
45 return $this->parameter;
46 }
47}
48
49
54{
55 public function __construct($parameter, \Exception $previous = null)
56 {
57 $message = sprintf("Argument '%s' is null or empty", $parameter);
58 parent::__construct($message, $parameter, $previous);
59 }
60}
61
62
67{
68 protected $lowerLimit;
69 protected $upperLimit;
70
79 public function __construct($parameter, $lowerLimit = null, $upperLimit = null, \Exception $previous = null)
80 {
81 if (is_array($lowerLimit))
82 $message = sprintf("The value of an argument '%s' is outside the allowable range of values: %s", $parameter, implode(", ", $lowerLimit));
83 elseif (($lowerLimit !== null) && ($upperLimit !== null))
84 $message = sprintf("The value of an argument '%s' is outside the allowable range of values: from %s to %s", $parameter, $lowerLimit, $upperLimit);
85 elseif (($lowerLimit === null) && ($upperLimit !== null))
86 $message = sprintf("The value of an argument '%s' is outside the allowable range of values: not greater than %s", $parameter, $upperLimit);
87 elseif (($lowerLimit !== null) && ($upperLimit === null))
88 $message = sprintf("The value of an argument '%s' is outside the allowable range of values: not less than %s", $parameter, $lowerLimit);
89 else
90 $message = sprintf("The value of an argument '%s' is outside the allowable range of values", $parameter);
91
92 $this->lowerLimit = $lowerLimit;
93 $this->upperLimit = $upperLimit;
94
95 parent::__construct($message, $parameter, $previous);
96 }
97
98 public function getLowerLimitType()
99 {
100 return $this->lowerLimit;
101 }
102
103 public function getUpperType()
104 {
105 return $this->upperLimit;
106 }
107}
108
109
114{
115 protected $requiredType;
116
124 public function __construct($parameter, $requiredType = "", \Exception $previous = null)
125 {
126 if (!empty($requiredType))
127 $message = sprintf("The value of an argument '%s' must be of type %s", $parameter, $requiredType);
128 else
129 $message = sprintf("The value of an argument '%s' has an invalid type", $parameter);
130
131 $this->requiredType = $requiredType;
132
133 parent::__construct($message, $parameter, $previous);
134 }
135
136 public function getRequiredType()
137 {
138 return $this->requiredType;
139 }
140}
141
142
147{
148 public function __construct($message = "", \Exception $previous = null)
149 {
150 parent::__construct($message, 140, '', 0, $previous);
151 }
152}
153
154
159{
160 public function __construct($message = "", \Exception $previous = null)
161 {
162 parent::__construct($message, 150, '', 0, $previous);
163 }
164}
165
170{
171 public function __construct($message = "", \Exception $previous = null)
172 {
173 parent::__construct($message, 160, '', 0, $previous);
174 }
175}
176
181{
182 public function __construct($parameter = "", \Exception $previous = null)
183 {
184 parent::__construct("Object property \"".$parameter."\" not found.", $parameter, $previous);
185 }
186}
187
192{
193 public function __construct($message = "", \Exception $previous = null)
194 {
195 parent::__construct($message, 500, '', 0, $previous);
196 }
197}
198
203{
204 public function __construct($message = "", \Exception $previous = null)
205 {
206 parent::__construct($message, 510, '', 0, $previous);
207 }
208}
209
214{
215 public function __construct($message = "", \Exception $previous = null)
216 {
217 parent::__construct(($message ?: 'Access denied.'), 403, '', 0, $previous);
218 }
219}
220
222{
223}
__construct($message="", \Exception $previous=null)
__construct($message="", $parameter="", \Exception $previous=null)
Definition exception.php:37
__construct($parameter, \Exception $previous=null)
Definition exception.php:55
__construct($parameter, $lowerLimit=null, $upperLimit=null, \Exception $previous=null)
Definition exception.php:79
__construct($parameter, $requiredType="", \Exception $previous=null)
__construct($message="", \Exception $previous=null)
__construct($message="", \Exception $previous=null)
__construct($message="", \Exception $previous=null)
__construct($message="", \Exception $previous=null)
__construct($message="", \Exception $previous=null)
__construct($parameter="", \Exception $previous=null)
__construct($message="", $code=0, $file="", $line=0, \Exception $previous=null)
Definition exception.php:18