Closed yothgewalt closed 12 months ago
target := &typesense.HTTPError{} // nolint:exhaustruct
if errors.As(err, &target) {
t := *target
fmt.Println(t.Status, t.Body)
}
target := &typesense.HTTPError{} // nolint:exhaustruct if errors.As(err, &target) { t := *target fmt.Println(t.Status, t.Body) }
Thank you, Its working!
Description
I don't know how to check the error type, for example, is it 404 or 409 etc.
Now I replace it by using the split function to grab the httpcode and check it.
And I'd like to ask, is there a better way?
Steps to reproduce
Expected Behavior
Actual Behavior
Metadata
Typesense Version:
OS: