linux: Wrap error with contextual message

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure
2017-06-14 08:50:58 -07:00
parent 171759a233
commit 33598cc5d3
3 changed files with 19 additions and 16 deletions

View File

@@ -23,6 +23,7 @@ import (
protobuf "github.com/gogo/protobuf/types"
google_protobuf "github.com/golang/protobuf/ptypes/empty"
specs "github.com/opencontainers/image-spec/specs-go"
"github.com/pkg/errors"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
@@ -129,7 +130,7 @@ func (s *Service) Create(ctx context.Context, r *api.CreateRequest) (*api.Create
}
c, err := runtime.Create(ctx, r.ContainerID, opts)
if err != nil {
return nil, err
return nil, errors.Wrap(err, "runtime create failed")
}
state, err := c.State(ctx)
if err != nil {