github.com/gophercloud/gophercloud@v1.11.0/openstack/identity/v3/policies/errors.go (about)

     1  package policies
     2  
     3  import "fmt"
     4  
     5  // InvalidListFilter is returned by the ToPolicyListQuery method when
     6  // validation of a filter does not pass
     7  type InvalidListFilter struct {
     8  	FilterName string
     9  }
    10  
    11  func (e InvalidListFilter) Error() string {
    12  	s := fmt.Sprintf(
    13  		"Invalid filter name [%s]: it must be in format of TYPE__COMPARATOR",
    14  		e.FilterName,
    15  	)
    16  	return s
    17  }
    18  
    19  // StringFieldLengthExceedsLimit is returned by the
    20  // ToPolicyCreateMap/ToPolicyUpdateMap methods when validation of
    21  // a type does not pass
    22  type StringFieldLengthExceedsLimit struct {
    23  	Field string
    24  	Limit int
    25  }
    26  
    27  func (e StringFieldLengthExceedsLimit) Error() string {
    28  	return fmt.Sprintf("String length of field [%s] exceeds limit (%d)",
    29  		e.Field, e.Limit,
    30  	)
    31  }