Added logger
[appc.git] / appc-adapters / appc-chef-adapter / appc-chef-adapter-bundle / src / main / java / org / onap / appc / adapter / chef / chefclient / impl / ChefApiClientImpl.java
index f86b490..2857f9f 100644 (file)
@@ -6,6 +6,8 @@
  * ================================================================================
  * Copyright (C) 2017 Amdocs
  * =============================================================================
+ * Modifications Copyright (C) 2019 IBM
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -99,8 +101,10 @@ public class ChefApiClientImpl implements ChefApiClient {
             String responseBody = EntityUtils.toString(httpEntity);
             return ChefResponse.create(statusCode, responseBody);
         } catch (IOException ex) {
+            logger.error("Error occured while reading response", ex.getMessage(), ex);
             return ChefResponse.create(HttpStatus.SC_INTERNAL_SERVER_ERROR, ex.getMessage());
         } catch (URISyntaxException ex) {
+            logger.error("Malformed URL", ex.getMessage(), ex);
             return ChefResponse.create(HttpStatus.SC_INTERNAL_SERVER_ERROR, ex.getMessage());
         }
     }