MCPcopy Create free account
hub / github.com/DoNewsCode/core / ExampleError_GRPCStatus

Function ExampleError_GRPCStatus

unierr/example_test.go:50–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48}
49
50func ExampleError_GRPCStatus() {
51 err := errors.New("my stuff is missing")
52 unifiedError := unierr.Wrap(err, codes.NotFound)
53
54 grpcStatus := unifiedError.GRPCStatus()
55 fmt.Println(grpcStatus.Code())
56 fmt.Println(grpcStatus.Message())
57 // Output:
58 // NotFound
59 // my stuff is missing
60}

Callers

nothing calls this directly

Calls 2

WrapFunction · 0.92
GRPCStatusMethod · 0.80

Tested by

no test coverage detected