pulumi/pkg/backend/errors.go

48 lines
1.4 KiB
Go

package backend
import (
"fmt"
"strings"
"github.com/pkg/errors"
)
var (
// ErrNoPreviousDeployment is returned when there isn't a previous deployment.
ErrNoPreviousDeployment = errors.New("no previous deployment")
// ErrNotFound is returned when the requested entity is not found.
ErrNotFound = errors.New("not found")
)
// ConflictingUpdateError represents an error which occurred while starting an update/destroy operation.
// Another update of the same stack was in progress, so the operation got cancelled due to this conflict.
type ConflictingUpdateError struct {
Err error // The error that occurred while starting the operation.
}
func (c ConflictingUpdateError) Error() string {
return fmt.Sprintf("%s\nTo learn more about possible reasons and resolution, visit "+
"https://www.pulumi.com/docs/troubleshooting/#conflict", c.Err.Error())
}
// StackAlreadyExistsError is returned from CreateStack when the stack already exists in the backend.
type StackAlreadyExistsError struct {
StackName string
}
func (e StackAlreadyExistsError) Error() string {
return fmt.Sprintf("stack '%v' already exists", e.StackName)
}
// OverStackLimitError is returned from CreateStack when the organization is billed per-stack and
// is over its stack limit.
type OverStackLimitError struct {
Message string
}
func (e OverStackLimitError) Error() string {
m := e.Message
m = strings.Replace(m, "Conflict: ", "over stack limit: ", -1)
return m
}