github.com/johandry/terraform@v0.11.12-beta1/plugin/discovery/error.go (about)

     1  package discovery
     2  
     3  // Error is a type used to describe situations that the caller must handle
     4  // since they indicate some form of user error.
     5  //
     6  // The functions and methods that return these specialized errors indicate so
     7  // in their documentation. The Error type should not itself be used directly,
     8  // but rather errors should be compared using the == operator with the
     9  // error constants in this package.
    10  //
    11  // Values of this type are _not_ used when the error being reported is an
    12  // operational error (server unavailable, etc) or indicative of a bug in
    13  // this package or its caller.
    14  type Error string
    15  
    16  // ErrorNoSuitableVersion indicates that a suitable version (meeting given
    17  // constraints) is not available.
    18  const ErrorNoSuitableVersion = Error("no suitable version is available")
    19  
    20  // ErrorNoVersionCompatible indicates that all of the available versions
    21  // that otherwise met constraints are not compatible with the current
    22  // version of Terraform.
    23  const ErrorNoVersionCompatible = Error("no available version is compatible with this version of Terraform")
    24  
    25  // ErrorNoSuchProvider indicates that no provider exists with a name given
    26  const ErrorNoSuchProvider = Error("no provider exists with the given name")
    27  
    28  func (err Error) Error() string {
    29  	return string(err)
    30  }