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
Need error handling for inserting duplicate element into azks #6
Comments
Unfortunately, no. Debugging this, it seems this error originates from direction to the leaf as well as to self being --
|
I mean since the public contract of the API it to only interact with the Is there anywhere in the lib where this error case is specifically handled? Like in a |
I am not aware of any such locations where we specifically say the error is due to duplicate nodes. It is just that One thing we could do is to not insert duplicate nodes in the tests? @kevinlewi, should we investigate this further? Any pointers on what to look for to identify duplicate nodes? |
Sorry for the delayed reply on this @eozturk1 . So I guess what I mean is, let's suppose a consumer of this library accidentally attempts to insert duplicate nodes (not just in the tests). Right now, a "NoDirectionError" is thrown, which is ambiguous. Can we make it so that a more instructive error is thrown, that explicitly indicates that a duplicate node was attempted to be inserted? This might just be a matter of converting the "NoDirectionError" to a new error type like "DuplicateNodeInsertionError". But being careful to only convert this error in the actual event of a duplicate node (since we don't want the DuplicateNodeInsertionError to be thrown when something else unrelated goes wrong). Hope that makes sense! |
No longer relevant since we handle directory publishing with versioning |
Right now, if you insert an element that is already a member of azks, we get a
HistoryTreeNodeErr(DirectionIsNone)
error. Perhaps it would be best to clarify that it is a duplicate insertion error?We can also add a test for this error.
The text was updated successfully, but these errors were encountered: