mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-02 12:17:39 -06:00
05caff2ca3
This is part of a general effort to move all of Terraform's non-library package surface under internal in order to reinforce that these are for internal use within Terraform only. If you were previously importing packages under this prefix into an external codebase, you could pin to an earlier release tag as an interim solution until you've make a plan to achieve the same functionality some other way.
29 lines
550 B
Go
29 lines
550 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 (e nativeError) Source() Source {
|
|
// No source information available for a native error
|
|
return Source{}
|
|
}
|
|
|
|
func (e nativeError) FromExpr() *FromExpr {
|
|
// Native errors are not expression-related
|
|
return nil
|
|
}
|