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

Raft::new() returns a Result #94

Closed
Hoverbear opened this issue Jul 16, 2018 · 0 comments
Closed

Raft::new() returns a Result #94

Hoverbear opened this issue Jul 16, 2018 · 0 comments
Labels
Enhancement An improvement to existing code. Good First Issue A good issue for a new contributor. Help Wanted An issue with unsolved problems, looking for help.

Comments

@Hoverbear
Copy link
Contributor

Depends on:

Currently calling Raft::new() will panic if it is provided an invalid configuration.

https://github.com/pingcap/raft-rs/blob/18f1cd8bb1a452dd9a2e3a8c0b507fc138c1862d/src/raft.rs#L390-L391

The consequence of this is that the user of the Raft is not provided an opportunity to handle certain types of error.

Fixing this issue would include changing Raft::new() to return a Result<Raft<T>> instead of a Raft<T>. In order to do this you may need to add new error variants:

https://github.com/pingcap/raft-rs/blob/18f1cd8bb1a452dd9a2e3a8c0b507fc138c1862d/src/errors.rs#L19-L22.

@Hoverbear Hoverbear added Enhancement An improvement to existing code. Help Wanted An issue with unsolved problems, looking for help. Good First Issue A good issue for a new contributor. labels Jul 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement An improvement to existing code. Good First Issue A good issue for a new contributor. Help Wanted An issue with unsolved problems, looking for help.
Projects
None yet
Development

No branches or pull requests

1 participant