MCPcopy
hub / github.com/connectrpc/connect-go / ExampleError_Message

Function ExampleError_Message

error_example_test.go:28–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26)
27
28func ExampleError_Message() {
29 err := fmt.Errorf(
30 "another: %w",
31 connect.NewError(connect.CodeUnavailable, errors.New("failed to foo")),
32 )
33 if connectErr := (&connect.Error{}); errors.As(err, &connectErr) {
34 fmt.Println("underlying error message:", connectErr.Message())
35 }
36
37 // Output:
38 // underlying error message: failed to foo
39}
40
41func ExampleIsNotModifiedError() {
42 // Assume that the server from NewNotModifiedError's example is running on

Callers

nothing calls this directly

Calls 2

NewErrorFunction · 0.92
MessageMethod · 0.80

Tested by

no test coverage detected