@@ 169-175 (lines=7) @@ | ||
166 | /** |
|
167 | * Adds an exception that will be thrown. |
|
168 | */ |
|
169 | public function addException(\Exception $exception) |
|
170 | { |
|
171 | if (!$exception instanceof Exception) { |
|
172 | @trigger_error('Clients may only throw exceptions of type '.Exception::class.'. Setting an exception of class '.get_class($exception).' will not be possible anymore in the future', E_USER_DEPRECATED); |
|
173 | } |
|
174 | $this->exceptions[] = $exception; |
|
175 | } |
|
176 | ||
177 | /** |
|
178 | * Sets the default exception to throw when the list of added exceptions and responses is exhausted. |
|
@@ 182-188 (lines=7) @@ | ||
179 | * |
|
180 | * If both a default exception and a default response are set, the exception will be thrown. |
|
181 | */ |
|
182 | public function setDefaultException(\Exception $defaultException = null) |
|
183 | { |
|
184 | if (!$defaultException instanceof Exception) { |
|
185 | @trigger_error('Clients may only throw exceptions of type '.Exception::class.'. Setting an exception of class '.get_class($defaultException).' will not be possible anymore in the future', E_USER_DEPRECATED); |
|
186 | } |
|
187 | $this->defaultException = $defaultException; |
|
188 | } |
|
189 | ||
190 | /** |
|
191 | * Adds a response that will be returned in first in first out order. |