github.com/alkemics/goflow@v0.2.1/gfutil/gfgo/errors.go (about) 1 package gfgo 2 3 import ( 4 "fmt" 5 "go/types" 6 ) 7 8 type PkgError struct { 9 PkgPath string 10 Err error 11 } 12 13 func (e PkgError) Error() string { 14 return fmt.Sprintf("loading %s: %v", e.PkgPath, e.Err) 15 } 16 17 func (e PkgError) Unwrap() error { 18 return e.Err 19 } 20 21 type TypeError struct { 22 Type types.Type 23 } 24 25 func (e TypeError) Error() string { 26 return fmt.Sprintf("could no find type of %T", e.Type) 27 } 28 29 type InputParsingError struct { 30 InputIndex int 31 Err error 32 } 33 34 func (e InputParsingError) Error() string { 35 return fmt.Sprintf("could not read type of input #%d: %v", e.InputIndex, e.Err) 36 } 37 38 func (e InputParsingError) Unwrap() error { 39 return e.Err 40 }