github.com/aquasecurity/trivy-iac@v0.8.1-0.20240127024015-3d8e412cf0ab/pkg/scanners/cloudformation/parser/errors.go (about) 1 package parser 2 3 import ( 4 "fmt" 5 ) 6 7 type InvalidContentError struct { 8 source string 9 err error 10 } 11 12 func NewErrInvalidContent(source string, err error) *InvalidContentError { 13 return &InvalidContentError{ 14 source: source, 15 err: err, 16 } 17 } 18 func (e *InvalidContentError) Error() string { 19 return fmt.Sprintf("Invalid content in file: %s. Error: %v", e.source, e.err) 20 } 21 22 func (e *InvalidContentError) Reason() error { 23 return e.err 24 }