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

LMDBer methods throw KeyError on malformed keys. #576

Conversation

daidoji
Copy link
Contributor

@daidoji daidoji commented Sep 26, 2023

Note: I wish there was something a little more elegant to this fix, but it seemed better to keep the lmdb exceptions close to the classes and methods rather than trying something more fancy or a key_validation() type function to signal intent

LMBD throws lmdb.BadValSizeError which isn't very helpful (or caught) in the codebase although KeyErrors are because of the dict abstraction elsewhere. (Found while trying to resolve Issue #575)

So now the LMDB methods throw KeyError where appropriate and tests for all methods with empty keys now execute regardless of whether those methods had the issue or not.

LMBD throws lmdb.BadValSizeError which isn't very helpful (or caught) in
the codebase although KeyErrors are because of the dict abstraction
elsewhere.  (Found while trying to resolve Issue WebOfTrust#575)

So now the LMDB methods throw KeyError where appropriate and tests for
all methods with empty keys now execute regardless of whether those
methods had the issue or not.
Copy link
Member

@m00sey m00sey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed on call

@pfeairheller pfeairheller merged commit 8337de0 into WebOfTrust:development Sep 28, 2023
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

Successfully merging this pull request may close these issues.

3 participants