diff options
author | priyanshu <pagarwal@amdocs.com> | 2017-12-28 11:16:08 +0530 |
---|---|---|
committer | Michael Lando <ml636r@att.com> | 2018-01-02 15:51:37 +0000 |
commit | fda1e52700ef32986173cf0273fc94ebafb16cb5 (patch) | |
tree | 8ce6db2f4564ca5de24096543a410ecc27e9657a | |
parent | e303f8cbbec61cd7deb7576073e601e2c919367e (diff) |
YAML syntax errors are not being sent.
YAML syntax errors are not being sent in Validation Issue List.
Change-Id: I2a52ed4a26b29ca0a4f01bdd3abd8830b012f5af
Issue-ID: SDC-566
Signed-off-by: priyanshu <pagarwal@amdocs.com>
Signed-off-by: Yuli Shlosberg <ys9693@att.com>
-rw-r--r-- | src/main/java/org/openecomp/sdc/toscaparser/api/ImportsLoader.java | 4 | ||||
-rw-r--r-- | src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/ImportsLoader.java b/src/main/java/org/openecomp/sdc/toscaparser/api/ImportsLoader.java index 1fac3f1..5e94378 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/ImportsLoader.java +++ b/src/main/java/org/openecomp/sdc/toscaparser/api/ImportsLoader.java @@ -362,13 +362,13 @@ public class ImportsLoader { } catch(FileNotFoundException e) { ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE197", String.format( - "ImportError: Failed to load YAML from \"%s\"",importName))); + "ImportError: Failed to load YAML from \"%s\"" + e,importName))); al[0] = al[1] = null; return al; } catch(Exception e) { ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE198", String.format( - "ImportError: Exception from SnakeYAML file = \"%s\"",importName))); + "ImportError: Exception from SnakeYAML file = \"%s\"" + e,importName))); al[0] = al[1] = null; return al; } diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java b/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java index d4506e1..07cce1c 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java +++ b/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java @@ -153,10 +153,16 @@ public class ToscaTemplate extends Object { } catch (FileNotFoundException e) { log.error("ToscaTemplate - Exception loading yaml: {}", e.getMessage()); + log.error("Exception", e); + ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE275", + "ToscaTemplate - Exception loading yaml: -> " + e.getMessage())); return; } catch(Exception e) { - log.error("ToscaTemplate - Error loading yaml, aborting"); + log.error("ToscaTemplate - Error loading yaml, aborting -> ", e.getMessage()); + log.error("Exception", e); + ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE275", + "ToscaTemplate - Error loading yaml, aborting -> " + e.getMessage())); return; } |