Permalink
Browse files

return error when we send a message to a service without a listener f…

…or that method
  • Loading branch information...
1 parent 4eafd82 commit eede9095b987d0e74b3110f54ebfe564df327ab0 sugendran@sugendran.net committed May 6, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 index.js
View
@@ -184,6 +184,9 @@ function Server(options) {
if (method == "_ping") {
return respCallback(null, "_pong");
}
+ if (self.listeners(method).length === 0) {
+ return respCallback(new Error("no listener for method " + method));
+ }
params.push(respCallback);
params.splice(0, 0, method);
self.emit.apply(self, params);

0 comments on commit eede909

Please sign in to comment.