[ONOS-4351][ONOS-4524] Augment linking and defect fixed.
Change-Id: I7c8e8c90579eea4631e014c4906a543a3c249427
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaList.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaList.java
index 08351d2..8139339 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaList.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaList.java
@@ -102,22 +102,29 @@
* list info.
*
* @param yangPlugin YANG plugin config
- * @throws IOException IO operation fail
+ * @throws TranslatorException translator operation fail
*/
@Override
- public void generateCodeEntry(YangPluginConfig yangPlugin)
- throws IOException {
- generateCodeAndUpdateInParent(this, yangPlugin, true);
+ public void generateCodeEntry(YangPluginConfig yangPlugin) throws TranslatorException {
+ try {
+ generateCodeAndUpdateInParent(this, yangPlugin, true);
+ } catch (IOException e) {
+ throw new TranslatorException(
+ "Failed to prepare generate code entry for list node " + this.getName());
+ }
}
/**
* Creates a java file using the YANG list info.
*
- * @throws IOException IO operation fail
+ * @throws TranslatorException translator operation fail
*/
@Override
- public void generateCodeExit()
- throws IOException {
- getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_INTERFACE_WITH_BUILDER, this);
+ public void generateCodeExit() throws TranslatorException {
+ try {
+ getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_INTERFACE_WITH_BUILDER, this);
+ } catch (IOException e) {
+ throw new TranslatorException("Failed to generate code for list node " + this.getName());
+ }
}
}