Encapsule-Annex / jsgraph

Deprecated: Use the @encapsule/arccore package that includes the graph library
https://encapsule.io/docs/ARCcore/graph
MIT License
42 stars 5 forks source link

Empty start vector error message #42

Closed ChrisRus closed 8 years ago

ChrisRus commented 9 years ago

For breadth and depth-first traversal, default behavior is to call DirectedGraph.getRootVertices to obtain the start vertex set. Depending on graph topology, this set might be empty resulting in a v0.5.14 errors message:

'''jsgraph.directed.depthFirstTraverse algorithm failure: You have specified an empty starting vertex set for this traversal. This is allowed only if you set request.options.allowEmptyStartVector === true.'''

True, but not really enough to infer back root cause if you happen to dislike reading documentation, forget, or whatever.

Ideas:

We can track if we are taking default behavior or caller override (DirectedGraph.getRootVertices vs. client-provided start vertex set) and make the error message more descriptive:

Set 'request.options.allowEmptyStartVector true or provide a graph that has one or more root vertices, or specify your own start vertex set`

ChrisRus commented 8 years ago

Fixed in 087c864