Documentation ¶
Index ¶
- func As[T error](err error) (T, bool)
- func AsContains(err error, target any, message string) bool
- func Contains(err error, needle string) bool
- func FromAttributeError(path cty.Path, err error) diag.Diagnostic
- func IsA[T error](err error) bool
- func IsAErrorMessageContains[T ErrorWithErrorMessage](err error, needle string) bool
- func IsUnsupportedOperationInPartitionError(partition string, err error) bool
- func MessageContains(err error, code string, message string) bool
- func Must[T any](x T, err error) T
- func NewAttributeErrorDiagnostic(path cty.Path, summary, detail 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
- type ErrorWithErrorMessage
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 FromAttributeError ¶
func FromAttributeError(path cty.Path, err error) diag.Diagnostic
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 MessageContains ¶
MessageContains unwraps the error and returns true if the error matches all these conditions:
- err is of type awserr.Error, Error.Code() equals code, and Error.Message() contains message
- OR err if not of type awserr.Error as string contains both code and message
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 NewAttributeErrorDiagnostic ¶
func NewAttributeErrorDiagnostic(path cty.Path, summary, detail string) diag.Diagnostic
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
Types ¶
type ErrorWithErrorMessage ¶
type ErrorWithErrorMessage interface { error // contains filtered or unexported methods }