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