You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
314 B
Go
21 lines
314 B
Go
4 years ago
|
package errdefs
|
||
|
|
||
|
import "github.com/moby/buildkit/solver/pb"
|
||
|
|
||
|
type OpError struct {
|
||
|
error
|
||
|
Op *pb.Op
|
||
|
}
|
||
|
|
||
|
func (e *OpError) Unwrap() error {
|
||
|
return e.error
|
||
|
}
|
||
|
|
||
|
func WithOp(err error, iface interface{}) error {
|
||
|
op, ok := iface.(*pb.Op)
|
||
|
if err == nil || !ok {
|
||
|
return err
|
||
|
}
|
||
|
return &OpError{error: err, Op: op}
|
||
|
}
|