goraph icon indicating copy to clipboard operation
goraph copied to clipboard

Export an Error to signify missing nodes

Open beano opened this issue 7 years ago • 2 comments

goraph uses errors.New() to create errors to signal missing graph nodes in numerous places. e.g.

return fmt.Errorf("%s does not exist in the graph.", id1)

It would be better to create specific error type instead. This would reduce code duplication and would allow callers to distinguish missing nodes from other things that may have go wrong when using the library.

beano avatar Feb 22 '18 18:02 beano

Could you send a PR to implement this? Thanks!

gyuho avatar Feb 22 '18 19:02 gyuho

I'll try to get something out within the next week.

beano avatar Feb 23 '18 08:02 beano