diff options
author | Jose <jose@zeroc.com> | 2018-03-16 22:02:04 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2018-03-16 22:02:54 +0100 |
commit | 7625e5ae0179762010c83ded8771b43a07f22519 (patch) | |
tree | f87a69459e09adce01b03128897b6c224a92ee6b /js/test/Ice/inheritance/Server.js | |
parent | Updated instructions to use python3 (diff) | |
download | ice-7625e5ae0179762010c83ded8771b43a07f22519.tar.bz2 ice-7625e5ae0179762010c83ded8771b43a07f22519.tar.xz ice-7625e5ae0179762010c83ded8771b43a07f22519.zip |
handle JavaScript server failure to connect echo server
Diffstat (limited to 'js/test/Ice/inheritance/Server.js')
-rw-r--r-- | js/test/Ice/inheritance/Server.js | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/js/test/Ice/inheritance/Server.js b/js/test/Ice/inheritance/Server.js index 1bca955fd30..a413678b510 100644 --- a/js/test/Ice/inheritance/Server.js +++ b/js/test/Ice/inheritance/Server.js @@ -18,16 +18,30 @@ let communicator; try { - communicator = Ice.initialize(initData); - const echo = await Test.EchoPrx.uncheckedCast(communicator.stringToProxy("__echo:default -p 12010")); - const adapter = await communicator.createObjectAdapter(""); - const base = communicator.stringToProxy("initial:default -p 12010"); - adapter.add(new InitialI(adapter, base), Ice.stringToIdentity("initial")); - await echo.setConnection(); - echo.ice_getCachedConnection().setAdapter(adapter); - ready.resolve(); - await communicator.waitForShutdown(); - await echo.shutdown(); + let echo; + try + { + communicator = Ice.initialize(initData); + echo = await Test.EchoPrx.checkedCast(communicator.stringToProxy("__echo:default -p 12010")); + const adapter = await communicator.createObjectAdapter(""); + const base = communicator.stringToProxy("initial:default -p 12010"); + adapter.add(new InitialI(adapter, base), Ice.stringToIdentity("initial")); + await echo.setConnection(); + echo.ice_getCachedConnection().setAdapter(adapter); + ready.resolve(); + await communicator.waitForShutdown(); + } + catch(ex) + { + ready.reject(ex); + } + finally + { + if(echo) + { + await echo.shutdown(); + } + } } finally { |