diff --git a/cmd/soc/main.go b/cmd/soc/main.go index ccae66c7e..0a4c78c20 100644 --- a/cmd/soc/main.go +++ b/cmd/soc/main.go @@ -1,7 +1,6 @@ package main import ( - "errors" "fmt" "log" "math" @@ -23,6 +22,11 @@ Usage: `) } +// matchesError replaces errors.Is for errors returned from GRPC +func matchesError(err, match error) bool { + return strings.Contains(err.Error(), match.Error()) +} + func main() { if len(os.Args) < 3 { usage() @@ -76,7 +80,7 @@ func main() { var err error start := time.Now() - for soc, err = v.SoC(); err != nil && errors.Is(err, api.ErrMustRetry); { + for soc, err = v.SoC(); err != nil && matchesError(err, api.ErrMustRetry); { if time.Since(start) > time.Minute { err = api.ErrTimeout } else {