Issue #1869 Ensure RecordFactory throws NoPluginException when there is no plugin.

Former-commit-id: f49bcb30a9 [formerly 5bb01374b9] [formerly 772ecd6e46] [formerly 58b51b725c [formerly 772ecd6e46 [formerly 50da6ea32b6d876d70d8c4d7a4914f5bb17b4c62]]]
Former-commit-id: 58b51b725c
Former-commit-id: fd2464a73f231b57a8dbc3163e7c274a17d5ebe4 [formerly 414b679b0a]
Former-commit-id: b65f1d4da0
This commit is contained in:
Ben Steffensmeier 2013-06-05 10:09:39 -05:00
parent 6f09a11696
commit 99f69f5b44

View file

@ -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);
}
}
}