Raft::new() returns a Result #94
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.
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 aResult<Raft<T>>
instead of aRaft<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.
The text was updated successfully, but these errors were encountered: