Remove handling stderr

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

Branch: refs/heads/master
Commit: 506c24239e7e3f8f8d6a730232739d7f53da7a23
Parents: 7e36ce5
Author: lewuathe <[email protected]>
Authored: Thu Mar 19 22:45:01 2015 +0900
Committer: lewuathe <[email protected]>
Committed: Thu Mar 19 22:45:01 2015 +0900

----------------------------------------------------------------------
 bin/storm | 29 ++---------------------------
 1 file changed, 2 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/506c2423/bin/storm
----------------------------------------------------------------------
diff --git a/bin/storm b/bin/storm
index b84ac82..cf5b19d 100755
--- a/bin/storm
+++ b/bin/storm
@@ -165,30 +165,6 @@ def parse_args(string):
     args = [re.compile(r"'((?:[^'\\]|\\.)*)'").sub('\\1', x) for x in args]
     return [re.compile(r'\\(.)').sub('\\1', x) for x in args]
 
-def handle_exception(output):
-    """
-    Handle exception which is thrown by thrift interface
-    by extracting its stdout and stderr
-    :param output:
-    :return:
-    """
-    re_exception = re.compile('^Exception in thread "main" ([^:(]+)[:(](.+)$')
-    lines = output.split('\n')
-    matches = None
-    for line in lines:
-        matches = re_exception.search(line)
-        if matches:
-            break
-    if matches:
-        exception_classname = matches.group(1)
-        exception_message   = matches.group(2)
-        if exception_classname == "java.lang.RuntimeException":
-            print("{0}: A nimbus exception is occurred.{1}"
-                  .format(exception_classname, exception_message))
-            sys.exit(1)
-        elif exception_classname == "NotAliveException":
-            print("{}: Topology is not alive".format(exception_classname))
-            sys.exit(2)
 
 
 def exec_storm_class(klass, jvmtype="-server", jvmopts=[], extrajars=[], 
args=[], fork=False):
@@ -213,9 +189,8 @@ def exec_storm_class(klass, jvmtype="-server", jvmopts=[], 
extrajars=[], args=[]
             ret = sub.check_output(all_args, stderr=sub.STDOUT)
             print(ret)
         except sub.CalledProcessError as e:
-            # Handling exception with stdout and stderr
-            if e.returncode != 0:
-                handle_exception(e.output)
+            # Handling exception from JVM
+            sys.exit(e.returncode)
 
 
 

Reply via email to