...

Source file src/sigs.k8s.io/cli-utils/pkg/object/error.go

Documentation: sigs.k8s.io/cli-utils/pkg/object

     1  // Copyright 2022 The Kubernetes Authors.
     2  // SPDX-License-Identifier: Apache-2.0
     3  
     4  package object
     5  
     6  import (
     7  	"fmt"
     8  )
     9  
    10  // InvalidAnnotationError represents an invalid annotation.
    11  // Fields are exposed to allow callers to perform introspection.
    12  type InvalidAnnotationError struct {
    13  	Annotation string
    14  	Cause      error
    15  }
    16  
    17  func (iae InvalidAnnotationError) Error() string {
    18  	return fmt.Sprintf("invalid %q annotation: %v",
    19  		iae.Annotation, iae.Cause)
    20  }
    21  
    22  func (iae InvalidAnnotationError) Unwrap() error {
    23  	return iae.Cause
    24  }
    25  

View as plain text