@@ 93-99 (lines=7) @@ | ||
90 | /** |
|
91 | * Adds an exception that will be thrown. |
|
92 | */ |
|
93 | public function addException(\Exception $exception) |
|
94 | { |
|
95 | if (!$exception instanceof Exception) { |
|
96 | @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); |
|
97 | } |
|
98 | $this->exceptions[] = $exception; |
|
99 | } |
|
100 | ||
101 | /** |
|
102 | * Sets the default exception to throw when the list of added exceptions and responses is exhausted. |
|
@@ 106-112 (lines=7) @@ | ||
103 | * |
|
104 | * If both a default exception and a default response are set, the exception will be thrown. |
|
105 | */ |
|
106 | public function setDefaultException(\Exception $defaultException = null) |
|
107 | { |
|
108 | if (!$defaultException instanceof Exception) { |
|
109 | @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); |
|
110 | } |
|
111 | $this->defaultException = $defaultException; |
|
112 | } |
|
113 | ||
114 | /** |
|
115 | * Adds a response that will be returned in first in first out order. |