terraform-provider-gitea/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/tfdiags/error.go
Tobias Trabelsi e1266ebf64
Some checks reported errors
continuous-integration/drone/pr Build encountered an error
continuous-integration/drone/push Build encountered an error
updated GHA
Update to v2 SDK
updated dependencies
2022-08-06 16:21:18 +02:00

25 lines
411 B
Go

package tfdiags
// nativeError is a Diagnostic implementation that wraps a normal Go error
type nativeError struct {
err error
}
var _ Diagnostic = nativeError{}
func (e nativeError) Severity() Severity {
return Error
}
func (e nativeError) Description() Description {
return Description{
Summary: FormatError(e.err),
}
}
func FromError(err error) Diagnostic {
return &nativeError{
err: err,
}
}