1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-01-23 17:53:05 +02:00
go-micro/client/is_retriable.go

22 lines
323 B
Go

package client
import (
"github.com/micro/go-micro/errors"
)
type IsRetriableFunc func(err error) bool
// always retry on error
func AlwaysRetry(err error) bool {
return true
}
func Only500Errors(err error) bool {
errorData := errors.Parse(err.Error())
if(errorData.Code >= 500) {
return true
}
return false
}