Files
docker-cli/vendor/github.com/moby/buildkit/solver/errdefs/fronetendcap.go
Sebastiaan van Stijn 9a0a071d55 vendor: buildkit v0.8.0-rc2, docker
diffs:

- full diff: af34b94a78...6c0a036dce
- full diff: 4d1f260e84...v0.8.0-rc2

New dependencies:

- go.opencensus.io v0.22.3
- github.com/containerd/typeurl v1.0.1
- github.com/golang/groupcache 869f871628b6baa9cfbc11732cdf6546b17c1298

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-12-02 21:01:12 +00:00

42 lines
930 B
Go

package errdefs
import (
fmt "fmt"
"github.com/containerd/typeurl"
"github.com/moby/buildkit/util/grpcerrors"
)
func init() {
typeurl.Register((*FrontendCap)(nil), "github.com/moby/buildkit", "errdefs.FrontendCap+json")
}
type UnsupportedFrontendCapError struct {
FrontendCap
error
}
func (e *UnsupportedFrontendCapError) Error() string {
msg := fmt.Sprintf("unsupported frontend capability %s", e.FrontendCap.Name)
if e.error != nil {
msg += ": " + e.error.Error()
}
return msg
}
func (e *UnsupportedFrontendCapError) Unwrap() error {
return e.error
}
func (e *UnsupportedFrontendCapError) ToProto() grpcerrors.TypedErrorProto {
return &e.FrontendCap
}
func NewUnsupportedFrontendCapError(name string) error {
return &UnsupportedFrontendCapError{FrontendCap: FrontendCap{Name: name}}
}
func (v *FrontendCap) WrapError(err error) error {
return &UnsupportedFrontendCapError{error: err, FrontendCap: *v}
}