Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't fail silently? #20

Closed
james-d-mitchell opened this issue May 14, 2024 · 1 comment
Closed

Don't fail silently? #20

james-d-mitchell opened this issue May 14, 2024 · 1 comment

Comments

@james-d-mitchell
Copy link
Member

At present there are a number of operations (such as GraphvizRemoveNode) that do nothing if their arguments are valid.
For example, doing GraphvizRemoveNode(gv, "non-existent-node"); just returns gv unaltered. This might be ok, but we should try to be consistent everywhere and do one of the following:

  1. Nothing (currently what happens)
  2. Issue a warning that "non-existent-node" doesn't exist and that the first argument will be unaltered;
  3. Issue an error

There might be some merit in having code that just doesn't error out, but just carries on. On the other hand, I think this will violate the principal of least astonishment, i.e. I have a graph, I remove a node (mistyping its name), and no nodes are removed (surprised face!). I think issuing a warning is the minimum we should do, but think errors would be better (there's no way to inadvertently ignore an error whereas a warning can be disabled, swallowed by something else, ignored or just overlooked).

What say @mpan322 and @mtorpey ? I'm raising this issue for discussion about what's desirable, rather than as a TODO for anyone.

@james-d-mitchell
Copy link
Member Author

Fixed by #28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant