Documentation ¶
Index ¶
- Variables
- func BetterHclDiagsToError(prefix string, diags hcl.Diagnostics) error
- func CombineErrors(errors ...error) error
- func CombineErrorsWithPrefix(prefix string, errors ...error) error
- func DecodePgError(err error) error
- func DiagsToError(prefix string, diags tfdiags.Diagnostics) error
- func FailOnError(err error)
- func FailOnErrorWithMessage(err error, message string)
- func HandleCancelError(err error) error
- func HclDiagsToError(prefix string, diags hcl.Diagnostics) error
- func HclDiagsToWarnings(diags hcl.Diagnostics) []string
- func InvalidCloudTokenError() error
- func IsCancelledError(err error) bool
- func IsContextCanceled(ctx context.Context) bool
- func IsContextCancelledError(err error) bool
- func IsInvalidCloudToken(err error) bool
- func IsInvalidWorkspaceDatabaseArg(err error) bool
- func MergeErrors(errs []error) []string
- func MissingCloudTokenError() error
- func PrefixError(err error, prefix string) error
- func RegisterCredentialType(credentialType string)
- func ShowError(ctx context.Context, err error)
- func ShowErrorWithMessage(ctx context.Context, err error, message string)
- func ShowWarning(warning string)
- func TransformErrorToSteampipe(err error) error
- func WrapError(err error) error
- type ErrorAndWarnings
- func (r *ErrorAndWarnings) AddWarning(warnings ...string)
- func (r *ErrorAndWarnings) Empty() bool
- func (r *ErrorAndWarnings) GetError() error
- func (r *ErrorAndWarnings) Merge(other ErrorAndWarnings) ErrorAndWarnings
- func (r *ErrorAndWarnings) ShowWarnings()
- func (r *ErrorAndWarnings) WrapErrorWithMessage(msg string) ErrorAndWarnings
Constants ¶
This section is empty.
Variables ¶
View Source
var InvalidStateError = errors.New("invalid state")
Functions ¶
func BetterHclDiagsToError ¶ added in v1.0.0
This is not the best guess, but it's sufficient for now. We can improve this later to add more context or making sure that the error is relevant. The plumbing is at least here.
func CombineErrors ¶
func CombineErrorsWithPrefix ¶
func DecodePgError ¶
func DiagsToError ¶
func DiagsToError(prefix string, diags tfdiags.Diagnostics) error
DiagsToError converts tfdiags diags into an error
func FailOnError ¶
func FailOnError(err error)
func FailOnErrorWithMessage ¶
func HandleCancelError ¶
HandleCancelError modifies a context.Canceled error into a readable error that can be printed on the console
func HclDiagsToError ¶
func HclDiagsToWarnings ¶ added in v1.0.0
func HclDiagsToWarnings(diags hcl.Diagnostics) []string
HclDiagsToWarnings converts warning diags into a list of warning strings
func InvalidCloudTokenError ¶
func InvalidCloudTokenError() error
func IsCancelledError ¶
func IsContextCanceled ¶
func IsContextCancelledError ¶
func IsInvalidCloudToken ¶
func MergeErrors ¶
func MissingCloudTokenError ¶
func MissingCloudTokenError() error
func PrefixError ¶
func RegisterCredentialType ¶ added in v1.0.0
func RegisterCredentialType(credentialType string)
func ShowErrorWithMessage ¶
ShowErrorWithMessage displays the given error nicely with the given message
func ShowWarning ¶
func ShowWarning(warning string)
func TransformErrorToSteampipe ¶
TransformErrorToSteampipe removes the pq: and rpc error prefixes along with all the unnecessary information that comes from the drivers and libraries
Types ¶
type ErrorAndWarnings ¶
func DiagsToErrorsAndWarnings ¶
func DiagsToErrorsAndWarnings(errPrefix string, diags hcl.Diagnostics) ErrorAndWarnings
func EmptyErrorsAndWarning ¶
func EmptyErrorsAndWarning() ErrorAndWarnings
func NewErrorsAndWarning ¶
func NewErrorsAndWarning(err error, warnings ...string) ErrorAndWarnings
func (*ErrorAndWarnings) AddWarning ¶
func (r *ErrorAndWarnings) AddWarning(warnings ...string)
func (*ErrorAndWarnings) Empty ¶
func (r *ErrorAndWarnings) Empty() bool
func (*ErrorAndWarnings) GetError ¶
func (r *ErrorAndWarnings) GetError() error
func (*ErrorAndWarnings) Merge ¶
func (r *ErrorAndWarnings) Merge(other ErrorAndWarnings) ErrorAndWarnings
func (*ErrorAndWarnings) ShowWarnings ¶
func (r *ErrorAndWarnings) ShowWarnings()
func (*ErrorAndWarnings) WrapErrorWithMessage ¶
func (r *ErrorAndWarnings) WrapErrorWithMessage(msg string) ErrorAndWarnings
Click to show internal directories.
Click to hide internal directories.