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

committing transaction returns lmdb::Error instead of StoreError #115

Closed
mykmelez opened this issue Feb 4, 2019 · 0 comments · Fixed by #116
Closed

committing transaction returns lmdb::Error instead of StoreError #115

mykmelez opened this issue Feb 4, 2019 · 0 comments · Fixed by #116

Comments

@mykmelez
Copy link
Contributor

mykmelez commented Feb 4, 2019

The recent changes in #101 directly expose the lmdb::RoTransaction and lmdb::RwTransaction types instead of wrapping them in Reader and Writer types when calling Rkv.read() and Rkv.write().

This has the side-effect of also exposing the lmdb::Error type when calling R[o|w]Transaction.commit(), which was previously converted into a StoreError by the Reader.commit() and Writer.commit() functions.

And that's inconsistent with most of the other functions in the public API, including Environment.begin_r[o|w]_transaction() and the various Store::[Single|Multi|etc.]Store functions, which all wrap an lmdb::Error in a StoreError::LmdbError.

It's also obviously inconsistent with any other function that returns another type of StoreError, and it means that consumers of rkv need to handle both the StoreError type and the underlying lmdb::Error type.

We should ensure that the public API returns StoreError consistently to indicate failure.

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 a pull request may close this issue.

1 participant