1
1
/*
2
- * Copyright 2002-2022 the original author or authors.
2
+ * Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
16
16
17
17
package org .springframework .web .reactive ;
18
18
19
- import java .util .function .Function ;
20
-
21
- import reactor .core .publisher .Mono ;
22
-
23
19
import org .springframework .core .MethodParameter ;
24
20
import org .springframework .core .ResolvableType ;
25
21
import org .springframework .lang .Nullable ;
@@ -46,9 +42,6 @@ public class HandlerResult {
46
42
@ Nullable
47
43
private DispatchExceptionHandler exceptionHandler ;
48
44
49
- @ Nullable
50
- private Function <Throwable , Mono <HandlerResult >> exceptionHandlerFunction ;
51
-
52
45
53
46
/**
54
47
* Create a new {@code HandlerResult}.
@@ -149,40 +142,4 @@ public DispatchExceptionHandler getExceptionHandler() {
149
142
return this .exceptionHandler ;
150
143
}
151
144
152
- /**
153
- * {@link HandlerAdapter} classes can set this to have their exception
154
- * handling mechanism applied to response rendering and to deferred
155
- * exceptions when invoking a handler with an asynchronous return value.
156
- * @param function the error handler
157
- * @return the current instance
158
- * @deprecated in favor of {@link #setExceptionHandler(DispatchExceptionHandler)}
159
- */
160
- @ Deprecated (since = "6.0" , forRemoval = true )
161
- public HandlerResult setExceptionHandler (Function <Throwable , Mono <HandlerResult >> function ) {
162
- this .exceptionHandler = (exchange , ex ) -> function .apply (ex );
163
- this .exceptionHandlerFunction = function ;
164
- return this ;
165
- }
166
-
167
- /**
168
- * Whether there is an exception handler.
169
- * @deprecated in favor of checking via {@link #getExceptionHandler()}
170
- */
171
- @ Deprecated (since = "6.0" , forRemoval = true )
172
- public boolean hasExceptionHandler () {
173
- return (this .exceptionHandler != null );
174
- }
175
-
176
- /**
177
- * Apply the exception handler and return the alternative result.
178
- * @param failure the exception
179
- * @return the new result or the same error if there is no exception handler
180
- * @deprecated without a replacement; for internal invocation only, not used as of 6.0
181
- */
182
- @ Deprecated (since = "6.0" , forRemoval = true )
183
- public Mono <HandlerResult > applyExceptionHandler (Throwable failure ) {
184
- return (this .exceptionHandlerFunction != null ?
185
- this .exceptionHandlerFunction .apply (failure ) : Mono .error (failure ));
186
- }
187
-
188
145
}
0 commit comments