Closed
Description
The current documentation is:
// FromError returns a Status representing err if it was produced from this
// package or has a method `GRPCStatus() *Status`. Otherwise, ok is false and a
// Status is returned with codes.Unknown and the original error message.
The first statement is not true because the implementation does return nil, true
if the err
is nil.
The documentation could be improved to avoid that this function is used in wrong ways when not looking at the actual implementation.
What did you expect to see?
// FromError returns a Status representing err if it was produced from this
// package or has a method `GRPCStatus() *Status`.
// If err is nil then Status nil will be returned and ok is true. Otherwise, ok is false and a
// Status is returned with codes.Unknown and the original error message.
Activity