github.com/khulnasoft-lab/defsec@v1.0.5-0.20230827010352-5e9f46893d95/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 }