MCPcopy
hub / github.com/grpc/grpc-go / Convert

Function Convert

status/status.go:131–134  ·  view source on GitHub ↗

Convert is a convenience function which removes the need to handle the boolean return value from FromError.

(err error)

Source from the content-addressed store, hash-verified

129// Convert is a convenience function which removes the need to handle the
130// boolean return value from FromError.
131func Convert(err error) *Status {
132 s, _ := FromError(err)
133 return s
134}
135
136// Code returns the Code of the error if it is a Status error or if it wraps a
137// Status error. If that is not the case, it returns codes.OK if err is nil, or

Calls 1

FromErrorFunction · 0.85