opentofu/internal/experiments/errors.go
Martin Atkins 26e5320a78 Move experiments/ to internal/experiments/
This is part of a general effort to move all of Terraform's non-library
package surface under internal in order to reinforce that these are for
internal use within Terraform only.

If you were previously importing packages under this prefix into an
external codebase, you could pin to an earlier release tag as an interim
solution until you've make a plan to achieve the same functionality some
other way.
2021-05-17 14:09:07 -07:00

27 lines
663 B
Go

package experiments
import (
"fmt"
)
// UnavailableError is the error type returned by GetCurrent when the requested
// experiment is not recognized at all.
type UnavailableError struct {
ExperimentName string
}
func (e UnavailableError) Error() string {
return fmt.Sprintf("no current experiment is named %q", e.ExperimentName)
}
// ConcludedError is the error type returned by GetCurrent when the requested
// experiment is recognized as concluded.
type ConcludedError struct {
ExperimentName string
Message string
}
func (e ConcludedError) Error() string {
return fmt.Sprintf("experiment %q has concluded: %s", e.ExperimentName, e.Message)
}