Documentation ¶
Index ¶
- func DiagnosticString(d diag.Diagnostic) string
- func DiagnosticsError(diags diag.Diagnostics) error
- func FormatFabricError(err error) error
- func FriendlyError(err error) error
- func FriendlyErrorForMetalGo(err error, resp *http.Response) error
- func HasApplicationErrorCode(errors []rest.ApplicationError, code string) bool
- func HasErrorCode(errors []fabricv4.Error, code string) bool
- func HttpForbidden(resp *http.Response, err error) bool
- func HttpNotFound(resp *http.Response, err error) bool
- func IgnoreHttpResponseErrors(ignore ...func(resp *http.Response, err error) bool) func(resp *http.Response, err error) error
- func IgnoreResponseErrors(ignore ...func(resp *http.Response, err error) bool) func(resp *packngo.Response, err error) error
- func IsForbidden(err error) bool
- func IsNotAssigned(resp *http.Response, err error) bool
- func IsNotFound(err error) bool
- func IsRestNotFoundError(err error) bool
- func Must[T any](x T, err error) T
- func MustWithDiagnostics[T any](x T, diags diag.Diagnostics) T
- func NewResourceNotFoundWarningDiagnostic(err error) diag.Diagnostic
- type ErrorResponse
- type Errors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiagnosticString ¶ added in v1.31.0
func DiagnosticString(d diag.Diagnostic) string
DiagnosticString formats a Diagnostic If there is no `Detail`, only prints summary, otherwise prints both
func DiagnosticsError ¶ added in v1.31.0
func DiagnosticsError(diags diag.Diagnostics) error
DiagnosticsError returns an error containing all Diagnostic with SeverityError
func FormatFabricError ¶ added in v1.21.0
func FriendlyError ¶
FriendlyError improves error messages when the API error is blank or in an alternate format (as is the case with invalid token or loadbalancer errors)
func HasApplicationErrorCode ¶ added in v1.23.0
func IgnoreHttpResponseErrors ¶ added in v1.26.0
func IgnoreHttpResponseErrors(ignore ...func(resp *http.Response, err error) bool) func(resp *http.Response, err error) error
ignoreHttpResponseErrors ignores http response errors when matched by one of the provided checks
func IgnoreResponseErrors ¶
func IgnoreResponseErrors(ignore ...func(resp *http.Response, err error) bool) func(resp *packngo.Response, err error) error
ignoreResponseErrors ignores http response errors when matched by one of the provided checks
func IsForbidden ¶
func IsNotAssigned ¶
IsNotAssigned matches errors reported from unassigned virtual networks
func IsNotFound ¶
func IsRestNotFoundError ¶ added in v1.23.0
func Must ¶ added in v1.31.0
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 MustWithDiagnostics ¶ added in v1.31.0
func MustWithDiagnostics[T any](x T, diags diag.Diagnostics) T
MustWithDiagnostics is a generic implementation of the Go Must idiom [1, 2]. It panics if the provided Diagnostics has errors and returns x otherwise.
func NewResourceNotFoundWarningDiagnostic ¶ added in v1.31.0
func NewResourceNotFoundWarningDiagnostic(err error) diag.Diagnostic
Types ¶
type ErrorResponse ¶
func (*ErrorResponse) Error ¶
func (er *ErrorResponse) Error() string