Documentation
¶
Index ¶
- func APIError[T ~string](code T, message string) smithy.APIError
- func As[T error](err error) (T, bool)
- func Contains(err error, needle string) bool
- func IsA[T error](err error) bool
- func IsAErrorMessageContains[T ErrorWithErrorMessage](err error, needle string) bool
- func IsUnsupportedOperationInPartitionError(partition string, err error) bool
- func Must[T any](x T, err error) T
- func NewAtLeastOneOfChildrenError(parentPath cty.Path, paths ...cty.Path) diag.Diagnostic
- func NewAttributeConflictsWhenError(path, otherPath cty.Path, otherValue string) diag.Diagnostic
- func NewAttributeConflictsWhenWillBeError(path, otherPath cty.Path, otherValue string) diag.Diagnostic
- func NewAttributeErrorDiagnostic(path cty.Path, summary, detail string) diag.Diagnostic
- func NewAttributeRequiredError(parentPath cty.Path, attrname string) diag.Diagnostic
- func NewAttributeRequiredWhenError(neededPath, otherPath cty.Path, value string) diag.Diagnostic
- func NewAttributeRequiredWillBeError(parentPath cty.Path, attrname string) diag.Diagnostic
- func NewAttributeWarningDiagnostic(path cty.Path, summary, detail string) diag.Diagnostic
- func NewErrorDiagnostic(summary, detail string) diag.Diagnostic
- func NewIncorrectValueTypeAttributeError(path cty.Path, expected string) diag.Diagnostic
- func NewInvalidValueAttributeError(path cty.Path, detail string) diag.Diagnostic
- func NewInvalidValueAttributeErrorf(path cty.Path, format string, a ...any) diag.Diagnostic
- func NewWarningDiagnostic(summary, detail string) diag.Diagnostic
- func PathString(path cty.Path) string
- type ErrorWithErrorMessage
- type MessageError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
Contains returns true if the error matches all these conditions:
- err as string contains needle
func IsAErrorMessageContains ¶
func IsAErrorMessageContains[T ErrorWithErrorMessage](err error, needle string) bool
IsAErrorMessageContains returns whether or not the specified error is of the specified type and its ErrorMessage() value contains the specified needle.
func IsUnsupportedOperationInPartitionError ¶
IsUnsupportedOperationInPartitionError checks the partition and specific error to make an educated guess about whether the problem stems from a feature not being available in a non-standard partitions (e.g. ISO) that is normally available. A return value of `true` means that there is an error AND it suggests a feature is not supported in ISO. Be careful with a return value of `false`, which means either there is NO error or there is an error but not one that suggests an unsupported feature in ISO.
func Must ¶
Must is a generic implementation of the Go Must idiom [1, 2]. It panics if the provided error is non-nil and returns x otherwise.
func NewAtLeastOneOfChildrenError ¶
NewAtLeastOneOfChildrenError returns an error diagnostic indicating that at least on of the named children of parentPath is required.
func NewAttributeConflictsWhenError ¶
func NewAttributeConflictsWhenError(path, otherPath cty.Path, otherValue string) diag.Diagnostic
NewAttributeConflictsWhenError returns an error diagnostic indicating that the attribute at the given path cannot be specified when the attribute at otherPath has the given value.
func NewAttributeConflictsWhenWillBeError ¶
func NewAttributeConflictsWhenWillBeError(path, otherPath cty.Path, otherValue string) diag.Diagnostic
NewAttributeConflictsWhenWillBeError returns a warning diagnostic indicating that the attribute at the given path cannot be specified when the attribute at otherPath has the given value. This is intended to be used for situations where the conflict will become an error in a future release.
func NewAttributeErrorDiagnostic ¶
func NewAttributeErrorDiagnostic(path cty.Path, summary, detail string) diag.Diagnostic
func NewAttributeRequiredError ¶
func NewAttributeRequiredError(parentPath cty.Path, attrname string) diag.Diagnostic
NewAttributeRequiredWhenError should only be used for apply-time validation, as it replicates the functionality of a `Required` attribute
func NewAttributeRequiredWhenError ¶
func NewAttributeRequiredWhenError(neededPath, otherPath cty.Path, value string) diag.Diagnostic
NewAttributeRequiredWhenError returns an error diagnostic indicating that the attribute at neededPath is required when the attribute at otherPath has the given value.
func NewAttributeRequiredWillBeError ¶
func NewAttributeRequiredWillBeError(parentPath cty.Path, attrname string) diag.Diagnostic
NewAttributeRequiredWillBeError returns a warning diagnostic indicating that the attribute at the given path is required. This is intended to be used for situations where the missing attribute will be an error in a future release.
func NewAttributeWarningDiagnostic ¶
func NewAttributeWarningDiagnostic(path cty.Path, summary, detail string) diag.Diagnostic
func NewErrorDiagnostic ¶
func NewErrorDiagnostic(summary, detail string) diag.Diagnostic
func NewIncorrectValueTypeAttributeError ¶
func NewIncorrectValueTypeAttributeError(path cty.Path, expected string) diag.Diagnostic
func NewInvalidValueAttributeError ¶
func NewInvalidValueAttributeError(path cty.Path, detail string) diag.Diagnostic
func NewWarningDiagnostic ¶
func NewWarningDiagnostic(summary, detail string) diag.Diagnostic
func PathString ¶
Types ¶
type ErrorWithErrorMessage ¶
type ErrorWithErrorMessage interface {
error
// contains filtered or unexported methods
}
type MessageError ¶
type MessageError struct {
// contains filtered or unexported fields
}
MessageError is a simple error type that implements the errorMessager
func NewMessageError ¶
func NewMessageError(err error) *MessageError
NewMessageError returns a new MessageError
func (*MessageError) ErrorMessage ¶
func (e *MessageError) ErrorMessage() string