github.com/Azure/aad-pod-identity@v1.8.17/pkg/auth/errors.go (about)

     1  package auth
     2  
     3  import "github.com/Azure/go-autorest/autorest/adal"
     4  
     5  // IsTokenRefreshError returns true if the error is a TokenRefreshError.
     6  // This method can be used to distinguish health check errors from token refresh errors.
     7  func IsTokenRefreshError(err error) bool {
     8  	_, ok := err.(adal.TokenRefreshError)
     9  	return ok
    10  }
    11  
    12  // IsHealthCheckError returns true if the error is not a token refresh error.
    13  func IsHealthCheckError(err error) bool {
    14  	return !IsTokenRefreshError(err)
    15  }