File tree 2 files changed +45
-14
lines changed
main/java/org/springframework/web/client
test/java/org/springframework/http/server/reactive
2 files changed +45
-14
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2002-2024 the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ package org .springframework .web .client ;
18
+
19
+ import java .io .IOException ;
20
+
21
+ import org .springframework .http .client .ClientHttpResponse ;
22
+
23
+ /**
24
+ * A basic, no operation {@link ResponseErrorHandler} implementation suitable
25
+ * for ignoring any error.
26
+ *
27
+ * @author Stephane Nicoll
28
+ * @since 6.1.7
29
+ */
30
+ public final class NoOpResponseErrorHandler implements ResponseErrorHandler {
31
+
32
+ @ Override
33
+ public boolean hasError (ClientHttpResponse response ) throws IOException {
34
+ return false ;
35
+ }
36
+
37
+ @ Override
38
+ public void handleError (ClientHttpResponse response ) throws IOException {
39
+
40
+ }
41
+
42
+ }
Original file line number Diff line number Diff line change 22
22
23
23
import org .springframework .http .HttpStatus ;
24
24
import org .springframework .http .ResponseEntity ;
25
- import org .springframework .http .client .ClientHttpResponse ;
25
+ import org .springframework .web .client .NoOpResponseErrorHandler ;
26
26
import org .springframework .web .client .ResponseErrorHandler ;
27
27
import org .springframework .web .client .RestTemplate ;
28
28
import org .springframework .web .testfixture .http .server .reactive .bootstrap .AbstractHttpHandlerIntegrationTests ;
36
36
*/
37
37
class ErrorHandlerIntegrationTests extends AbstractHttpHandlerIntegrationTests {
38
38
39
+ private static final ResponseErrorHandler NO_OP_ERROR_HANDLER = new NoOpResponseErrorHandler ();
40
+
39
41
private final ErrorHandler handler = new ErrorHandler ();
40
42
41
43
@@ -110,17 +112,4 @@ else if (path.endsWith("handling-error")) {
110
112
}
111
113
}
112
114
113
-
114
- private static final ResponseErrorHandler NO_OP_ERROR_HANDLER = new ResponseErrorHandler () {
115
-
116
- @ Override
117
- public boolean hasError (ClientHttpResponse response ) {
118
- return false ;
119
- }
120
-
121
- @ Override
122
- public void handleError (ClientHttpResponse response ) {
123
- }
124
- };
125
-
126
115
}
You can’t perform that action at this time.
0 commit comments