Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

return a Result<Error> instead of panicking #6

Closed
mykmelez opened this issue Jul 31, 2018 · 0 comments
Closed

return a Result<Error> instead of panicking #6

mykmelez opened this issue Jul 31, 2018 · 0 comments
Labels
ARCHIVED CLOSED at time of archiving

Comments

@mykmelez
Copy link

If you try to open more databases than an environment is configured to support, then lmdb-rs panics (with a DbsFull error). It should return an error instead.

And that seems true in general as well: when an error occurs, rather than panicking—which the consumer may or may not want—return an error (i.e. a Result<Error>), and let the consumer decide what to do with it (handle it, panic, etc.).

Upstream has issues for other panics, like danburkert#13, danburkert#27, danburkert#31, and danburkert#33; the first of which suggests that @danburkert would be amenable to returning a Result instead of panicking (at least in that case).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ARCHIVED CLOSED at time of archiving
Projects
None yet
Development

No branches or pull requests

2 participants