You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
263 B
Go
13 lines
263 B
Go
1 year ago
|
package nstatus
|
||
|
|
||
|
// ConvertErr is a convenience function which removes the need to handle the
|
||
|
// boolean return value from FromError.
|
||
|
func ConvertErr(err error) *Result {
|
||
|
s, ok := FromError(err)
|
||
|
if !ok {
|
||
|
// 尝试grpc
|
||
|
return WrapGrpcErr(err)
|
||
|
}
|
||
|
return s
|
||
|
}
|