[Entanglement] Log a warning on cycle detection

nasa/openmctweb#84
This commit is contained in:
Victor Woeltjen 2015-09-17 13:42:08 -07:00
parent d1c0d81120
commit 88b8528aaf

View File

@ -69,9 +69,18 @@ define(
}
return objectService.getObjects([id]).then(function (objects) {
return exclude[id] ?
objects[id] : // Don't loop indefinitely.
attachContextForLocation(objects[id]);
if (exclude[id]) {
$log.warn([
"LocatingObjectDecorator detected a cycle",
"while attempted to define a context for",
id + ";",
"no context will be added and unexpected behavior",
"may follow."
].join(" "));
return objects[id];
}
return attachContextForLocation(objects[id]);
});
}