1 package org.onap.nbi.exceptions;
3 import org.springframework.http.client.ClientHttpResponse;
4 import org.springframework.web.client.DefaultResponseErrorHandler;
5 import org.springframework.web.client.ResponseErrorHandler;
6 import java.io.IOException;
8 public class BackendErrorHandler implements ResponseErrorHandler {
10 private ResponseErrorHandler errorHandler = new DefaultResponseErrorHandler();
13 public boolean hasError(ClientHttpResponse response) throws IOException {
14 return errorHandler.hasError(response);
18 public void handleError(ClientHttpResponse response) throws IOException {
19 if (response.getStatusCode() != null) {
20 throw new BackendFunctionalException(response.getStatusCode(), response.getStatusText());