@@ 153-159 (lines=7) @@ | ||
150 | /** |
|
151 | * Adds an exception that will be thrown. |
|
152 | */ |
|
153 | public function addException(\Exception $exception) |
|
154 | { |
|
155 | if (!$exception instanceof Exception) { |
|
156 | @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); |
|
157 | } |
|
158 | $this->exceptions[] = $exception; |
|
159 | } |
|
160 | ||
161 | /** |
|
162 | * Sets the default exception to throw when the list of added exceptions and responses is exhausted. |
|
@@ 166-172 (lines=7) @@ | ||
163 | * |
|
164 | * If both a default exception and a default response are set, the exception will be thrown. |
|
165 | */ |
|
166 | public function setDefaultException(\Exception $defaultException = null) |
|
167 | { |
|
168 | if (!$defaultException instanceof Exception) { |
|
169 | @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); |
|
170 | } |
|
171 | $this->defaultException = $defaultException; |
|
172 | } |
|
173 | ||
174 | /** |
|
175 | * Adds a response that will be returned in first in first out order. |