2018-01-10 18:52:15 +00:00
|
|
|
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{
|
2019-04-15 20:39:47 +00:00
|
|
|
Summary: FormatError(e.err),
|
2018-01-10 18:52:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e nativeError) Source() Source {
|
|
|
|
// No source information available for a native error
|
|
|
|
return Source{}
|
|
|
|
}
|
2019-04-15 20:39:47 +00:00
|
|
|
|
|
|
|
func (e nativeError) FromExpr() *FromExpr {
|
|
|
|
// Native errors are not expression-related
|
|
|
|
return nil
|
|
|
|
}
|