[fix] emit an error if proper URL is not passed in as a target

This commit is contained in:
Jarrett Cruger 2014-08-14 13:32:32 -04:00
parent 63c53a1772
commit 37036dd325

View File

@ -64,7 +64,9 @@ function createRightProxy(type) {
options[e] = parse_url(options[e]); options[e] = parse_url(options[e]);
}); });
if(typeof this.emit === 'undefined' && !cbl) { throw new Error("You need to pass a callback to handle errors") } if (!options.target && !options.forward) {
return this.emit('error', new Error('Must provide a proper URL as target'));
}
for(var i=0; i < passes.length; i++) { for(var i=0; i < passes.length; i++) {
/** /**