Skip to content
This repository was archived by the owner on May 17, 2021. It is now read-only.

Commit 407d1dc

Browse files
authored
fix: COMPASS-4209: Add missing returns on error cases (#69)
1 parent 3620a65 commit 407d1dc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/fetch.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ function getIndexes(results, done) {
3333
.collection(ns.collection)
3434
.indexes(function(err, indexes) {
3535
if (err) {
36+
debug('getIndexes failed!', err);
3637
done(err);
38+
return;
3739
}
3840
// add ns field to each index
3941
_.each(indexes, function(idx) {
@@ -80,7 +82,8 @@ function getIndexStats(results, done) {
8082
debug('$indexStats not yet supported, return empty document', err);
8183
return done(null, {});
8284
}
83-
done(err);
85+
debug('Unknown error while getting index stats!', err);
86+
return done(err);
8487
}
8588
res = _.mapKeys(res, function(stat) {
8689
return stat.name;

0 commit comments

Comments
 (0)