Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDiagnosticOnError ¶ added in v0.18.0
func AddDiagnosticOnError(diag *diag.Diagnostics, summary string, err error) bool
AddDiagnosticOnError is a helper function which will take an error and a context-specific summary of the action.
If err is nil, this function will return false. If err is non-nil, this function will return ture and take one the following actions:
- if it is a client.DetailedError, a DetailedErrorDiagnostic will be added to diag.
- otherwise a generic error diagnostic will be added to diag.
func AsStringSlice ¶ added in v0.18.0
AsStringSlice converts a slice of string-like things to a slice of strings.
Types ¶
type DetailedErrorDiagnostic ¶ added in v0.18.0
type DetailedErrorDiagnostic struct {
// contains filtered or unexported fields
}
DetailedErrorDiagnostic is a Diagnostic which nicely wraps a client.DetailedError
func NewDetailedErrorDiagnostic ¶ added in v0.18.0
func NewDetailedErrorDiagnostic(summary string, e *client.DetailedError) DetailedErrorDiagnostic
NewDetailedErrorDiagnostic creates a new DetailedErrorDiagnostic taking a context-specific summary of the action and a DetailedError.
func (DetailedErrorDiagnostic) Detail ¶ added in v0.18.0
func (d DetailedErrorDiagnostic) Detail() string
func (DetailedErrorDiagnostic) Equal ¶ added in v0.18.0
func (d DetailedErrorDiagnostic) Equal(other diag.Diagnostic) bool
func (DetailedErrorDiagnostic) Severity ¶ added in v0.18.0
func (d DetailedErrorDiagnostic) Severity() diag.Severity
func (DetailedErrorDiagnostic) Summary ¶ added in v0.18.0
func (d DetailedErrorDiagnostic) Summary() string
Click to show internal directories.
Click to hide internal directories.