Updated js-graph and am using the new 'hasCycle' method rather than relying on a thrown exception.