PathFind should pass on errors with the pathfind request.

This commit is contained in:
Stefan Thomas
2013-08-21 16:59:51 -07:00
parent c9d081f2c6
commit 87790b330e

View File

@@ -48,12 +48,15 @@ PathFind.prototype.create = function ()
function handleInitialPath(err, msg) {
if (err) {
// XXX Handle error
self.emit('error', err);
return;
}
self.notify_update(msg);
}
// XXX We should add ourselves to prepare_subscribe or a similar mechanism so
// that we can resubscribe after a reconnection.
req.request();
};
@@ -81,6 +84,9 @@ PathFind.prototype.notify_update = function (message)
PathFind.prototype.notify_superceded = function ()
{
// XXX If we're set to re-subscribe whenever we connect to a new server, then
// we should cancel that behavior here. See PathFind#create.
this.emit('end');
this.emit('superceded');
};