tonic
tonic copied to clipboard
Return a Result type from the PersistentChannel instead of unwrapping.
Currently the PersistentChannel constructor panics if the URL cannot be parsed. This adds a check for a parse error and returns a corresponding Status::INVALID_ARGUMENT if the parse failed. Using the Status struct should be conformant with the C++ implementation and the current tonic implementation.
Motivation
Standardize error handling, handle a TODO.
Solution
Using a Result object to return. The Status code is to conform with the gRPC spec