From 772ecd6e46191809fbdf8712bc3ce9360facda70 Mon Sep 17 00:00:00 2001 From: Ben Steffensmeier Date: Wed, 5 Jun 2013 10:09:39 -0500 Subject: [PATCH] Issue #1869 Ensure RecordFactory throws NoPluginException when there is no plugin. Former-commit-id: 50da6ea32b6d876d70d8c4d7a4914f5bb17b4c62 --- .../src/com/raytheon/uf/viz/core/RecordFactory.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/RecordFactory.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/RecordFactory.java index 2caf926800..1fbb05fc3a 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/RecordFactory.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/RecordFactory.java @@ -153,6 +153,15 @@ public class RecordFactory implements IPluginClassMapper { map.put("dataURI", dataURI); return map; } catch (Exception e) { + // if this exception was caused by NoPlugin then throw that so that + // caller knows exactly why this happened. + Throwable cause = e.getCause(); + while (cause != null) { + if (cause instanceof NoPluginException) { + throw (NoPluginException) cause; + } + cause = cause.getCause(); + } throw new VizException("Unable to create property map for " + dataURI, e); } @@ -251,7 +260,7 @@ public class RecordFactory implements IPluginClassMapper { try { return getPluginClass(pluginName); } catch (NoPluginException e) { - throw new PluginException(e.getLocalizedMessage()); + throw new PluginException(e.getLocalizedMessage(), e); } } } \ No newline at end of file