From 5895be67ab61d7b97247b23482558c2bd95d02d7 Mon Sep 17 00:00:00 2001 From: Yuli Shlosberg Date: Thu, 18 Oct 2018 14:59:56 +0300 Subject: failed to import a tosca vsp proper prints have added to log Change-Id: I73e0441036dbc7206f148cf8fe8a21f6266397ce Issue-ID: SDC-1683 Signed-off-by: Yuli Shlosberg --- .../sdc/be/components/impl/ArtifactsBusinessLogic.java | 8 ++++---- .../components/impl/exceptions/ComponentException.java | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java index ebdbcea535..03ffdd5fa6 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java @@ -78,12 +78,12 @@ import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum; import org.openecomp.sdc.common.api.ArtifactTypeEnum; import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.common.datastructure.Wrapper; +import org.openecomp.sdc.common.log.wrappers.Logger; import org.openecomp.sdc.common.util.GeneralUtility; import org.openecomp.sdc.common.util.ValidationUtils; import org.openecomp.sdc.common.util.YamlToObjectConverter; import org.openecomp.sdc.exception.ResponseFormat; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; + import org.springframework.beans.factory.annotation.Autowired; import org.xml.sax.*; import org.yaml.snakeyaml.Yaml; @@ -119,7 +119,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { public static final String HEAT_ENV_SUFFIX = "env"; private static final String ARTIFACT_PLACEHOLDER_FILE_EXTENSION = "fileExtension"; - private static final Logger log = LoggerFactory.getLogger(ArtifactsBusinessLogic.class); + private static final Logger log = Logger.getLogger(ArtifactsBusinessLogic.class); public static final String FAILED_UPDATE_GROUPS = "Failed to update groups of the component {}. "; public static final String FAILED_UPDATE_ARTIFACT = "Failed to delete or update the artifact {}. Parent uniqueId is {}"; public static final String FAILED_SAVE_ARTIFACT = "Failed to save the artifact."; @@ -3258,7 +3258,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { // currently done separately else { if (!isArtifactMetadataUpdate) { - log.debug("Payload is missing."); + log.debug("In artifact: {} Payload is missing.",artifactInfo.getArtifactName()); ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.MISSING_DATA, ARTIFACT_PAYLOAD); return Either.right(responseFormat); } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/exceptions/ComponentException.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/exceptions/ComponentException.java index 69ac1b892a..72d54873d2 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/exceptions/ComponentException.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/exceptions/ComponentException.java @@ -3,6 +3,8 @@ package org.openecomp.sdc.be.components.impl.exceptions; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.exception.ResponseFormat; +import java.util.Arrays; + public class ComponentException extends RuntimeException { /** @@ -39,5 +41,21 @@ public class ComponentException extends RuntimeException { return params.clone(); } + @Override + public String getMessage() { + return this.toString(); + } + + @Override + public String toString() { + return "ComponentException{" + + "responseFormat=" + responseFormat + + ", actionStatus=" + actionStatus + + ", params=" + Arrays.toString(params) + + '}'; + } + + + } -- cgit 1.2.3-korg