mirror of
https://github.com/Xahau/xahau.js.git
synced 2026-08-23 16:40:52 +00:00
PathFind should pass on errors with the pathfind request.
This commit is contained in:
@@ -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');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user