1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Make errors from graphdriver init friendlier

In several cases graphdriver were just returning the low-level syscall
error and that was making it all the way up to the daemon logs and in
many cases was difficult to tell it was even coming from the graphdriver
at all.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff 2015-03-12 06:15:32 -07:00
parent 830544044e
commit c0f7819905
3 changed files with 3 additions and 3 deletions

View file

@ -876,7 +876,7 @@ func NewDaemonFromDirectory(config *Config, eng *engine.Engine) (*Daemon, error)
// Load storage driver // Load storage driver
driver, err := graphdriver.New(config.Root, config.GraphOptions) driver, err := graphdriver.New(config.Root, config.GraphOptions)
if err != nil { if err != nil {
return nil, err return nil, fmt.Errorf("error intializing graphdriver: %v", err)
} }
log.Debugf("Using graph driver %s", driver) log.Debugf("Using graph driver %s", driver)

View file

@ -378,7 +378,7 @@ func (a *Driver) mount(id, mountLabel string) error {
} }
if err := a.aufsMount(layers, rw, target, mountLabel); err != nil { if err := a.aufsMount(layers, rw, target, mountLabel); err != nil {
return err return fmt.Errorf("error creating aufs mount to %s: %v", target, err)
} }
return nil return nil
} }

View file

@ -301,7 +301,7 @@ func (d *Driver) Get(id string, mountLabel string) (string, error) {
opts := fmt.Sprintf("lowerdir=%s,upperdir=%s,workdir=%s", lowerDir, upperDir, workDir) opts := fmt.Sprintf("lowerdir=%s,upperdir=%s,workdir=%s", lowerDir, upperDir, workDir)
if err := syscall.Mount("overlay", mergedDir, "overlay", 0, label.FormatMountLabel(opts, mountLabel)); err != nil { if err := syscall.Mount("overlay", mergedDir, "overlay", 0, label.FormatMountLabel(opts, mountLabel)); err != nil {
return "", err return "", fmt.Errorf("error creating overlay mount to %s: %v", mergedDir, err)
} }
mount.path = mergedDir mount.path = mergedDir
mount.mounted = true mount.mounted = true