Commit fe32fff 1 parent 5f3d8d7 commit fe32fff Copy full SHA for fe32fff
File tree 1 file changed +4
-12
lines changed
1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -247,19 +247,11 @@ errors can still be unwrapped using the APIError.
247
247
log.Println(ae.Reason())
248
248
log.Println(ae.Details().Help.GetLinks())
249
249
}
250
- }
251
-
252
- If the gRPC transport was used, the [google.golang.org/grpc/status.Status] can
253
- still be parsed using the [google.golang.org/grpc/status.FromError] function.
254
-
255
- if err != nil {
256
- if s, ok := status.FromError(err); ok {
257
- log.Println(s.Message())
258
- for _, d := range s.Proto().Details {
259
- log.Println(d)
260
- }
250
+ // If a gRPC transport was used you can extract the
251
+ // google.golang.org/grpc/status.Status from the error
252
+ s := ae.GRPCStatus()
253
+ log.Println(s.Code())
261
254
}
262
- }
263
255
264
256
# Client Stability
265
257
You can’t perform that action at this time.
0 commit comments