return a Result<Error> instead of panicking
mykmelez opened this issue · 0 comments
mykmelez commented
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).