Merge "Improve error logging in yang-store-impl"
authorEd Warnicke <eaw@cisco.com>
Thu, 9 Jan 2014 07:25:00 +0000 (07:25 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 9 Jan 2014 07:25:00 +0000 (07:25 +0000)
opendaylight/config/yang-store-impl/src/main/java/org/opendaylight/controller/config/yang/store/impl/ExtenderYangTracker.java

index 9356dd3752331f2f34fcc33b5df87151081a04b7..0d704a8f6aa49825da36d62b011d9294479fbb3d 100644 (file)
@@ -186,7 +186,15 @@ public class ExtenderYangTracker extends BundleTracker<Object> implements YangSt
                     yangStoreSnapshot.countModuleMXBeanEntries(), multimap.values().size());
             return yangStoreSnapshot;
         } catch (RuntimeException e) {
-            throw new YangStoreException("Unable to parse yang files from following URLs: " + multimap, e);
+            StringBuffer causeStr = new StringBuffer();
+            Throwable cause = e;
+            while (cause != null) {
+                causeStr.append(e.getMessage());
+                causeStr.append("\n");
+                cause = e.getCause();
+            }
+            throw new YangStoreException("Unable to parse yang files. \n" + causeStr.toString() +
+                    "URLs: " + multimap, e);
         }
     }