CoreyKaylor / Lightning.NET

.NET library for LMDB key-value store
Other
397 stars 82 forks source link

AsEnumerable fails silently #139

Closed Jure-BB closed 2 years ago

Jure-BB commented 3 years ago

If an error occurs during enumeration when using AsEnumerable extension method, enumeration fails silently without reporting an error.

The reason seems to be that this method only checks for MDBResultCode.Success result code and treats all other codes as MDBResultCode.NotFound. It should probably throw an exception, if result code is neither Success or NotFound.

AlgorithmsAreCool commented 3 years ago

Taking a look...

CoreyKaylor commented 3 years ago

Yes, thanks for reporting. I'll probably remove the if check and provide a convenience extension method to throw on error. That way it's consistent with the rest of the API.

CoreyKaylor commented 3 years ago

Take it back, I don't want to change the return type. I'll throw on error instead.