File tree Expand file tree Collapse file tree 2 files changed +45
-14
lines changed
main/java/org/springframework/web/client
test/java/org/springframework/http/server/reactive Expand file tree Collapse file tree 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 2222
2323import org .springframework .http .HttpStatus ;
2424import org .springframework .http .ResponseEntity ;
25- import org .springframework .http .client .ClientHttpResponse ;
25+ import org .springframework .web .client .NoOpResponseErrorHandler ;
2626import org .springframework .web .client .ResponseErrorHandler ;
2727import org .springframework .web .client .RestTemplate ;
2828import org .springframework .web .testfixture .http .server .reactive .bootstrap .AbstractHttpHandlerIntegrationTests ;
3636 */
3737class ErrorHandlerIntegrationTests extends AbstractHttpHandlerIntegrationTests {
3838
39+ private static final ResponseErrorHandler NO_OP_ERROR_HANDLER = new NoOpResponseErrorHandler ();
40+
3941 private final ErrorHandler handler = new ErrorHandler ();
4042
4143
@@ -110,17 +112,4 @@ else if (path.endsWith("handling-error")) {
110112 }
111113 }
112114
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-
126115}
You can’t perform that action at this time.
0 commit comments