From f37cf89f8eddc57dc1df5e3c0b0f2ae25388afd0 Mon Sep 17 00:00:00 2001 From: Spencer T Brody Date: Mon, 20 Jul 2015 14:18:41 -0400 Subject: SERVER-19493 Include 'code' field in thrown js Error objects where possible --- jstests/sharding/replset_config/bad_config_load.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'jstests') 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 } } -- cgit v1.2.1