STORM-1750: Replace manual check for exception cause with try-cause

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

Branch: refs/heads/0.10.x-branch
Commit: b66f9071378d556edbb55dce1b864d4f59a07788
Parents: aaf3abf
Author: Stig Rohde Døssing <[email protected]>
Authored: Thu May 5 11:12:52 2016 +0200
Committer: Stig Rohde Døssing <[email protected]>
Committed: Thu May 5 11:12:52 2016 +0200

----------------------------------------------------------------------
 storm-core/src/clj/backtype/storm/cluster.clj | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/b66f9071/storm-core/src/clj/backtype/storm/cluster.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/cluster.clj 
b/storm-core/src/clj/backtype/storm/cluster.clj
index 174987f..7c603b3 100644
--- a/storm-core/src/clj/backtype/storm/cluster.clj
+++ b/storm-core/src/clj/backtype/storm/cluster.clj
@@ -103,12 +103,10 @@
          (zk/set-data zk path data)
          (do
            (zk/mkdirs zk (parent-path path) acls)
-           (try
+           (try-cause
              (zk/create-node zk path data :persistent acls)
-             (catch RuntimeException e
-               (if (instance? KeeperException$NodeExistsException (.getCause 
e))
-                 (zk/set-data zk path data)
-                 (throw e)))))))
+             (catch KeeperException$NodeExistsException e
+               (zk/set-data zk path data))))))
 
      (delete-node
        [this path]

Reply via email to