Replies: 1 comment
-
var apiError api.ErrorStatusCode
resp, err := client.Operation(ctx)
switch {
case errors.As(err, &apiError):
// API error.
fmt.Println(apiError.Message)
case err != nil:
// Any other error.
default:
// No error.
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Using the client, is it possible to get the API response out of a 'convenient error' or should this functionality be disabled if we want to do anything other than print a JSON error?
Beta Was this translation helpful? Give feedback.
All reactions