You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by pt...@apache.org on 2015/06/03 19:35:27 UTC

[13/50] [abbrv] storm git commit: when a resource can't be found, log an error and exit rather than throw NPE

when a resource can't be found, log an error and exit rather than throw NPE


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/2e44c9e6
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/2e44c9e6
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/2e44c9e6

Branch: refs/heads/master
Commit: 2e44c9e6a2fb4382950da463fad9f392f8991468
Parents: 11b0151
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Thu Apr 2 12:18:12 2015 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Thu Apr 2 12:18:12 2015 -0400

----------------------------------------------------------------------
 .../src/main/java/org/apache/storm/flux/parser/FluxParser.java   | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/2e44c9e6/flux-core/src/main/java/org/apache/storm/flux/parser/FluxParser.java
----------------------------------------------------------------------
diff --git a/flux-core/src/main/java/org/apache/storm/flux/parser/FluxParser.java b/flux-core/src/main/java/org/apache/storm/flux/parser/FluxParser.java
index 78c52d5..72f8a8e 100644
--- a/flux-core/src/main/java/org/apache/storm/flux/parser/FluxParser.java
+++ b/flux-core/src/main/java/org/apache/storm/flux/parser/FluxParser.java
@@ -63,6 +63,10 @@ public class FluxParser {
                                             String propertiesFile, boolean envSub) throws IOException {
         Yaml yaml = yaml();
         InputStream in = FluxParser.class.getResourceAsStream(resource);
+        if(in == null){
+            LOG.error("Unable to load classpath resource: " + resource);
+            System.exit(1);
+        }
         TopologyDef topology = loadYaml(yaml, in, propertiesFile, envSub);
         in.close();
         if(dumpYaml){