node-ari-client
node-ari-client copied to clipboard
Client.prototype.start undefined apps silently dies
If for some reason, a developer will try to start a Stasis application that has an undefined name (yes, it's stupid, but may happen), Client will not return any type of error or exception.
The issue should be handled within Client.prototype.start (I think):
Client.prototype.start = function (apps, subscribeAll, callback) {
var self = this;
// are we currently processing a WebSocket error?
var processingError = false;
// Perform argument renaming for backwards compatibility
if (typeof subscribeAll === 'function') {
callback = subscribeAll;
subscribeAll = null;
}
This may also provide some easy resolution for issue #35
Do you mean if Client.prototype.start is called without an application name, or if Client.prototype.start is called with an application name that does not exist on the Asterisk instance the client is connected to?
No, what happens is the following:
- The
start
method is invoked with an undefined value for theapps
variable - When that happens, node-ari will simply die silently with exit value of 0, not indicating an error.
I do believe that throwing an exception saying: "Stasis Application must define a name" or something like that is a must.
Agreed. I'll see if I can carve out some free time for this soon.