aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/nbi/exceptions/BackendErrorHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/onap/nbi/exceptions/BackendErrorHandler.java')
-rw-r--r--src/main/java/org/onap/nbi/exceptions/BackendErrorHandler.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/onap/nbi/exceptions/BackendErrorHandler.java b/src/main/java/org/onap/nbi/exceptions/BackendErrorHandler.java
index 48bf630..488ebd7 100644
--- a/src/main/java/org/onap/nbi/exceptions/BackendErrorHandler.java
+++ b/src/main/java/org/onap/nbi/exceptions/BackendErrorHandler.java
@@ -19,6 +19,8 @@ package org.onap.nbi.exceptions;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.client.ResponseErrorHandler;
@@ -26,7 +28,7 @@ import org.springframework.web.client.ResponseErrorHandler;
public class BackendErrorHandler implements ResponseErrorHandler {
private ResponseErrorHandler errorHandler = new DefaultResponseErrorHandler();
-
+ private static final Logger LOGGER = LoggerFactory.getLogger(BackendErrorHandler.class);
@Override
public boolean hasError(ClientHttpResponse response) throws IOException {
return errorHandler.hasError(response);
@@ -38,6 +40,7 @@ public class BackendErrorHandler implements ResponseErrorHandler {
String body = null;
if (response.getBody() != null) {
body = IOUtils.toString(response.getBody(), StandardCharsets.UTF_8.name());
+ LOGGER.error("BackendErrorHandler {} error : {}", response.getBody());
}
throw new BackendFunctionalException(response.getStatusCode(), response.getStatusText(), body);