Transfer better error handling to JS_ShardingTest