Skip to content

Commit

Permalink
mount: Improve error message
Browse files Browse the repository at this point in the history
Add the original error into the error returned by
`removeSandboxStorage()` to make it clearer to the caller what went
wrong.

Signed-off-by: James O. D. Hunt <[email protected]>
  • Loading branch information
jodh-intel committed Jul 18, 2019
1 parent c92715f commit 72fc0ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,11 @@ func (s *sandbox) removeSandboxStorage(path string) error {

err := removeMounts([]string{path})
if err != nil {
return grpcStatus.Errorf(codes.Unknown, "Unable to unmount sandbox storage path %s", path)
return grpcStatus.Errorf(codes.Unknown, "Unable to unmount sandbox storage path %s: %v", path, err)
}
err = os.RemoveAll(path)
if err != nil {
return grpcStatus.Errorf(codes.Unknown, "Unable to delete sandbox storage path %s", path)
return grpcStatus.Errorf(codes.Unknown, "Unable to delete sandbox storage path %s: %v", path, err)
}
return nil
}
Expand Down

0 comments on commit 72fc0ad

Please sign in to comment.