Srylax / mongodb-cursor-pagination

Provides cursor based pagination for the native MongoDB driver in Rust.
https://docs.rs/mongodb-cursor-pagination/
MIT License
2 stars 4 forks source link

Hotfix for version 0.3.2: Fixing panic issues caused by unwrap() calls #18

Open douggynix opened 3 weeks ago

douggynix commented 3 weeks ago

Delegate fatal error handling to the users of the library,

Linked Items

This PR is a hot fix for version 0.3.2. It is related to this commit a578bb4e1ac6d27204f568c686e007410ab068be And should be compared to it. The base branch to be compared against would be one that is based from this commit a578bb4e1ac6d27204f568c686e007410ab068be

This Pr is not intended to be merged with master.

## Description This PR fixes panic errors caused by the library due to the explicit use of **unwrap()** calls upon **Result** and **Option** This causes application to crash with panic. This PR is not intended to be merged with Master. it is intended as a hot fix for the current stable release which is 0.3.2. As it's been one year since this latest release candidate has not been released. This fix is really mandatory for the current stable release which me and other peers are using. ## Behaviour changes Old: Panic and caused application to crash if there are database or base64 encoding/decoding errors or any other types by the use of unsafe **unwrap** upon **Result** or **Option** type New: Map non related errors as CursorError::Unknown(String) and delegate the errors the caller(library users). Errors are being handled by application instead of the library ## Category This is related to a: - [x] Bugfix - [ ] Feature - [ ] Packaging - [ ] Docs - [ ] Code Quality - [ ] Refactoring - [ ] Miscellaneous ## Tests - [x] Unit-Tests were created - [ ] Code is already covered by Unit-Tests - [ ] No tests required