diff options
author | Jose <jose@zeroc.com> | 2017-06-23 08:58:51 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2017-06-23 08:58:51 +0200 |
commit | 128b269351e774123ee1a1a9ee74cf21e9901f88 (patch) | |
tree | 60009772bb4e4d6066b166921657c90f17bfeb85 /js | |
parent | Visual Studio project updates (diff) | |
download | ice-128b269351e774123ee1a1a9ee74cf21e9901f88.tar.bz2 ice-128b269351e774123ee1a1a9ee74cf21e9901f88.tar.xz ice-128b269351e774123ee1a1a9ee74cf21e9901f88.zip |
Improve error reporting of JavaScript Ice/binding test
Diffstat (limited to 'js')
-rw-r--r-- | js/test/Ice/binding/Client.js | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/js/test/Ice/binding/Client.js b/js/test/Ice/binding/Client.js index 4300d9ca48f..58facf7c8a8 100644 --- a/js/test/Ice/binding/Client.js +++ b/js/test/Ice/binding/Client.js @@ -93,20 +93,25 @@ }).catch( ex => { - test(ex instanceof Ice.CommunicatorDestroyedException); + test(ex instanceof Ice.CommunicatorDestroyedException, ex); }); }; return f1(ArrayUtil.clone(adapters)); }; var p = new Ice.Promise(); - var test = function(b) + var test = function(b, ex) { if(!b) { try { - throw new Error("test failed"); + var msg = "test failed"; + if(ex) + { + msg += ex.toString(); + } + throw new Error(msg); } catch(err) { @@ -191,7 +196,7 @@ }, function(ex) { - test(isConnectionFailed(ex)); + test(isConnectionFailed(ex), ex); out.writeLine("ok"); return initialize(); } @@ -544,7 +549,7 @@ return forEach(proxies, function(p) { - p.getAdapterName().catch(ex => test(ex instanceof Ice.LocalException)); + p.getAdapterName().catch(ex => test(ex instanceof Ice.LocalException), ex); }); } ).then( @@ -556,7 +561,7 @@ return proxy.ice_ping().catch( function(ex) { - test(ex instanceof Ice.LocalException); + test(ex instanceof Ice.LocalException, ex); }); }); } @@ -593,7 +598,7 @@ function(ex) { // Expected if adapter is down. - test(ex instanceof Ice.LocalException); + test(ex instanceof Ice.LocalException, ex); } ); })); @@ -636,8 +641,7 @@ }, function(ex) { - console.log(ex.stack); - test(false); + test(false, ex); } ).then( function(prx) @@ -701,7 +705,7 @@ }, function(ex) { - test(false); + test(false, ex); } ).then( function() @@ -777,7 +781,7 @@ }, function(ex) { - test(isConnectionFailed(ex)); + test(isConnectionFailed(ex), ex); return prx.ice_getEndpoints(); } ).then( @@ -881,7 +885,7 @@ }, function(ex) { - test(isConnectionFailed(ex)); + test(isConnectionFailed(ex), ex); }); }; return f1(); @@ -1048,7 +1052,7 @@ }, function(ex) { - test(isConnectionFailed(ex)); + test(isConnectionFailed(ex), ex); return prx.ice_getEndpoints(); } ).then( |