Skip to content
Browse files

throw when submitting function with no servers specified

  • Loading branch information...
1 parent 370a296 commit 8f8f0c3d91ff249be3de556b41c1e696d45ffb5b andris9 committed Jun 27, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/gearnode.js
View
4 lib/gearnode.js
@@ -406,6 +406,10 @@ Gearnode.prototype.submitJob = function(func_name, payload, options){
return false;
}
+ if(!this.server_names.length){
+ throw new Error("No Gearman servers specified");
+ }
+
var server = this.servers[this.server_names[this.server_names.length-1]];
return new Gearnode.GearmanJob(func_name, payload, options, server);

0 comments on commit 8f8f0c3

Please sign in to comment.
Something went wrong with that request. Please try again.