github.com/kanishk98/terraform@v1.3.0-dev.0.20220917174235-661ca8088a6a/internal/experiments/errors.go (about)

     1  package experiments
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  // UnavailableError is the error type returned by GetCurrent when the requested
     8  // experiment is not recognized at all.
     9  type UnavailableError struct {
    10  	ExperimentName string
    11  }
    12  
    13  func (e UnavailableError) Error() string {
    14  	return fmt.Sprintf("no current experiment is named %q", e.ExperimentName)
    15  }
    16  
    17  // ConcludedError is the error type returned by GetCurrent when the requested
    18  // experiment is recognized as concluded.
    19  type ConcludedError struct {
    20  	ExperimentName string
    21  	Message        string
    22  }
    23  
    24  func (e ConcludedError) Error() string {
    25  	return fmt.Sprintf("experiment %q has concluded: %s", e.ExperimentName, e.Message)
    26  }