terraform-provider-google/vendor/github.com/hashicorp/terraform/tfdiags/error.go
Riley Karson dbf9188792
Vendor 0.12 SDK (#3432)
```bash
GO111MODULE=on go get github.com/hashicorp/terraform@pluginsdk-v0.12-early7
GO111MODULE=on go mod vendor
GO111MODULE=on go mod tidy
```
2019-04-15 13:39:47 -07:00

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
}