Documentation
¶
Overview ¶
Package deployerrors holds the typed CompositeError implementations produced by component deploy (plan + apply) flows. It lives next to the installs domain that consumes it rather than in a central error catalog: each domain owns the custom errors it knows how to produce and parse.
Index ¶
Constants ¶
const AWSPermissionErrorType compositeerrors.Type = "terraform.aws_permission"
AWSPermissionErrorType is the discriminator for AWS IAM permission failures surfaced from a terraform plan/apply during a component deploy.
ComponentBuildUnavailableErrorType is the discriminator for a deploy that cannot proceed because the component it targets has no deployable build.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
func Parse(raw string) compositeerrors.CompositeError
Parse inspects raw terraform plan/apply error output and returns a typed AWSPermissionError when it recognises an AWS IAM permission failure. It returns nil when there is no confident match, so callers fall back to the existing plain-string status description.
Types ¶
type AWSPermissionError ¶
type AWSPermissionError struct {
// Action is the IAM action the caller lacked, e.g. "ec2:CreateVpc",
// "s3:CreateBucket".
Action string `json:"action"`
// Resource is the ARN (or wildcard) the call targeted, when known.
Resource string `json:"resource,omitempty"`
// Principal is the IAM principal ARN the call was made as, when known.
Principal string `json:"principal,omitempty"`
// AWSErrorCode is the API error code we matched on (AccessDenied,
// UnauthorizedOperation, AccessDeniedException, AuthorizationError).
AWSErrorCode string `json:"aws_error_code,omitempty"`
// RawMessage is the AWS-emitted error line we extracted the fields from.
RawMessage string `json:"raw_message,omitempty"`
}
AWSPermissionError is the typed payload for an AWS API call that failed with AccessDenied / UnauthorizedOperation because the deploy's IAM principal is missing a permission. It implements compositeerrors.CompositeError so it can be returned like any error and frozen onto the owning deploy row.
func (*AWSPermissionError) Error ¶
func (e *AWSPermissionError) Error() string
Error returns the one-line headline shown to users.
func (*AWSPermissionError) Hints ¶ added in v0.19.1024
func (e *AWSPermissionError) Hints() compositeerrors.Hints
Hints tells the orchestrator not to auto-retry: a missing IAM permission won't resolve by retrying, so burning the auto-retry budget only delays surfacing the actionable error. The step is parked for manual retry once the user grants the permission.
func (*AWSPermissionError) Sections ¶
func (e *AWSPermissionError) Sections() []compositeerrors.Section
Sections returns the structured detail rendered in the dashboard: what AWS said, the principal/resource context, and a copy-pasteable IAM policy statement granting the missing action.
func (*AWSPermissionError) Severity ¶
func (e *AWSPermissionError) Severity() compositeerrors.Severity
func (*AWSPermissionError) Type ¶
func (e *AWSPermissionError) Type() compositeerrors.Type
type ComponentBuildUnavailableError ¶ added in v0.19.1014
type ComponentBuildUnavailableError struct {
}
ComponentBuildUnavailableError is the typed payload for a deploy that cannot run because its component build is unavailable. It implements compositeerrors.CompositeError so it can be frozen onto the owning deploy row and rendered in the dashboard, guiding the user to (re)build the component.
func (*ComponentBuildUnavailableError) Error ¶ added in v0.19.1014
func (e *ComponentBuildUnavailableError) Error() string
func (*ComponentBuildUnavailableError) Sections ¶ added in v0.19.1014
func (e *ComponentBuildUnavailableError) Sections() []compositeerrors.Section
func (*ComponentBuildUnavailableError) Severity ¶ added in v0.19.1014
func (e *ComponentBuildUnavailableError) Severity() compositeerrors.Severity
func (*ComponentBuildUnavailableError) Type ¶ added in v0.19.1014
func (e *ComponentBuildUnavailableError) Type() compositeerrors.Type
type ComponentBuildUnavailableReason ¶ added in v0.19.1014
type ComponentBuildUnavailableReason string
ComponentBuildUnavailableReason describes why the build could not be deployed.
const ( // component is in a terminal failure state (error / policy_failed). ComponentBuildUnavailableReasonFailed ComponentBuildUnavailableReason = "failed" // component yet, so there is no artifact to deploy. ComponentBuildUnavailableReasonMissing ComponentBuildUnavailableReason = "missing" )