Browse Source

Refs #2378: handle errs setting Pipeline input src

Kyle P Davis 12 years ago
parent
commit
0c325f7334
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lib/pipeline/Pipeline.js

+ 2 - 1
lib/pipeline/Pipeline.js

@@ -185,7 +185,8 @@ var Pipeline = module.exports = (function(){
 		if(inputSource && !(inputSource instanceof DocumentSource)) throw new Error("arg `inputSource` must be an instance of DocumentSource");
 		if(!callback) throw new Error("arg `callback` required");
 		var self = this;
-		inputSource.setSource(undefined, function(){	//TODO: HACK: temp solution to the fact that we need to initialize our source since we're using setSource as a workaround for the lack of real async cursors
+		inputSource.setSource(undefined, function(err){	//TODO: HACK: temp solution to the fact that we need to initialize our source since we're using setSource as a workaround for the lack of real async cursors
+			if(err) return callback(err);
 			// chain together the sources we found
 			async.eachSeries(self.sourceVector,
 				function eachSrc(item, next){