mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #24754 from cpuguy83/24749_better_err_not_a_dir
Improve error message for ENOTDIR errors
This commit is contained in:
commit
bceacfa57f
1 changed files with 6 additions and 0 deletions
|
@ -158,6 +158,12 @@ func (daemon *Daemon) containerStart(container *container.Container) (err error)
|
||||||
container.SetExitCode(126)
|
container.SetExitCode(126)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// attempted to mount a file onto a directory, or a directory onto a file, maybe from user specified bind mounts
|
||||||
|
if strings.Contains(errDesc, syscall.ENOTDIR.Error()) {
|
||||||
|
errDesc += ": Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type"
|
||||||
|
container.SetExitCode(127)
|
||||||
|
}
|
||||||
|
|
||||||
container.Reset(false)
|
container.Reset(false)
|
||||||
|
|
||||||
return fmt.Errorf("%s", errDesc)
|
return fmt.Errorf("%s", errDesc)
|
||||||
|
|
Loading…
Reference in a new issue