get.porter.sh/porter@v1.3.0/pkg/cnab/cnab-to-oci/errors.go (about) 1 package cnabtooci 2 3 import ( 4 "fmt" 5 6 "get.porter.sh/porter/pkg/cnab" 7 ) 8 9 // ErrNotFound represents when a bundle or image is not found. 10 type ErrNotFound struct { 11 Reference cnab.OCIReference 12 } 13 14 func (e ErrNotFound) Is(target error) bool { 15 _, ok := target.(ErrNotFound) 16 return ok 17 } 18 19 func (e ErrNotFound) String() string { 20 return e.Error() 21 } 22 23 func (e ErrNotFound) Error() string { 24 return fmt.Sprintf("reference not found (%s)", e.Reference) 25 }