diff options
author | Spencer T Brody <spencer@mongodb.com> | 2015-07-20 14:18:41 -0400 |
---|---|---|
committer | Spencer T Brody <spencer@mongodb.com> | 2015-07-22 10:42:46 -0400 |
commit | f37cf89f8eddc57dc1df5e3c0b0f2ae25388afd0 (patch) | |
tree | d745f438c704bf83c82697ac0ce681c07626c831 /jstests | |
parent | 280b8e6c835bab826899a7696a1f5852e1221d53 (diff) | |
download | mongo-f37cf89f8eddc57dc1df5e3c0b0f2ae25388afd0.tar.gz |
SERVER-19493 Include 'code' field in thrown js Error objects where possible
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/sharding/replset_config/bad_config_load.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/jstests/sharding/replset_config/bad_config_load.js b/jstests/sharding/replset_config/bad_config_load.js index 63028c55565..8b9573c4451 100644 --- a/jstests/sharding/replset_config/bad_config_load.js +++ b/jstests/sharding/replset_config/bad_config_load.js @@ -40,12 +40,10 @@ for( var i = 0; i < 2; i++ ){ printjson( e ) // Make sure we get a transport error, and not a no-primary error - // Unfortunately e gets stringified so we have to test this way - assert(e.message.indexOf("10276") >= 0 || // Transport error - e.message.indexOf("13328") >= 0 || // Connect error - e.message.indexOf("13639") >= 0 || // Connect error to replSet primary - e.message.indexOf("network error") >= 0 || - e.message.indexOf("socket") >= 0 ) + assert(e.code == 10276 || // Transport error + e.code == 13328 || // Connect error + e.code == 13639 || // Connect error to replSet primary + e.code == 6); // Host unreachable } } |