aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-translator-lib
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-translator-lib')
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesServiceTemplates.java7
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/utils/ResourceWalker.java5
2 files changed, 7 insertions, 5 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesServiceTemplates.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesServiceTemplates.java
index 5490452155..99f550e8e4 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesServiceTemplates.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesServiceTemplates.java
@@ -20,7 +20,6 @@ import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum;
import org.openecomp.sdc.common.errors.CoreException;
import org.openecomp.sdc.common.errors.ErrorCategory;
import org.openecomp.sdc.common.errors.ErrorCode;
-import org.openecomp.sdc.logging.types.LoggerErrorDescription;
import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil;
import org.openecomp.sdc.tosca.services.ToscaUtil;
@@ -32,6 +31,8 @@ import java.util.Map;
public class GlobalTypesServiceTemplates {
+ private static final String FAILED_TO_GENERATE_GLOBAL_TYPES = "Failed to generate globalTypes";
+
private static final Map<OnboardingTypesEnum, Map<String, ServiceTemplate>>
onboardingGlobalTypesServiceTemplates;
@@ -46,7 +47,7 @@ public class GlobalTypesServiceTemplates {
throw coreException;
} catch (Exception exception) {
throw new CoreException((new ErrorCode.ErrorCodeBuilder())
- .withMessage(LoggerErrorDescription.FAILED_TO_GENERATE_GLOBAL_TYPES)
+ .withMessage(FAILED_TO_GENERATE_GLOBAL_TYPES)
.withId("GlobalTypes Read Error").withCategory(ErrorCategory.APPLICATION).build(),
exception);
}
@@ -57,7 +58,7 @@ public class GlobalTypesServiceTemplates {
onboardingType) {
if (onboardingType == null) {
throw new CoreException((new ErrorCode.ErrorCodeBuilder())
- .withMessage(LoggerErrorDescription.FAILED_TO_GENERATE_GLOBAL_TYPES)
+ .withMessage(FAILED_TO_GENERATE_GLOBAL_TYPES)
.withId("Invalid Onboarding Type").withCategory(ErrorCategory.APPLICATION).build());
}
return onboardingGlobalTypesServiceTemplates.get(onboardingType);
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/utils/ResourceWalker.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/utils/ResourceWalker.java
index dfeea57163..e5993677cd 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/utils/ResourceWalker.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/utils/ResourceWalker.java
@@ -20,7 +20,6 @@ import org.apache.commons.io.IOUtils;
import org.openecomp.sdc.common.errors.CoreException;
import org.openecomp.sdc.common.errors.ErrorCategory;
import org.openecomp.sdc.common.errors.ErrorCode;
-import org.openecomp.sdc.logging.types.LoggerErrorDescription;
import java.io.BufferedReader;
import java.io.File;
@@ -42,6 +41,8 @@ import java.util.zip.ZipFile;
public class ResourceWalker {
+ private static final String RESOURCE_FILE_READ_ERROR = "Can't read resource file from class path.";
+
private ResourceWalker() {
}
@@ -61,7 +62,7 @@ public class ResourceWalker {
filesContent.put(fileName, IOUtils.toString(reader));
} catch (IOException exception) {
throw new CoreException((new ErrorCode.ErrorCodeBuilder())
- .withMessage(LoggerErrorDescription.RESOURCE_FILE_READ_ERROR
+ .withMessage(RESOURCE_FILE_READ_ERROR
+ " File name = " + fileName)
.withId("Resource Read Error").withCategory(ErrorCategory.APPLICATION).build(),
exception);