1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/pkg
Kir Kolyshkin 6533136961 pkg/mount: wrap mount/umount errors
The errors returned from Mount and Unmount functions are raw
syscall.Errno errors (like EPERM or EINVAL), which provides
no context about what has happened and why.

Similar to os.PathError type, introduce mount.Error type
with some context. The error messages will now look like this:

> mount /tmp/mount-tests/source:/tmp/mount-tests/target, flags: 0x1001: operation not permitted

or

> mount tmpfs:/tmp/mount-test-source-516297835: operation not permitted

Before this patch, it was just

> operation not permitted

[v2: add Cause()]
[v3: rename MountError to Error, document Cause()]
[v4: fixes; audited all users]
[v5: make Error type private; changes after @cpuguy83 reviews]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-12-10 20:07:02 -08:00
..
aaparser
archive pkg/archive: fix TestTarUntarWithXattr failure on recent kernel 2018-11-29 16:14:35 +09:00
authorization Format code with gofmt -s from go-1.11beta1 2018-09-06 15:24:16 -07:00
broadcaster
chrootarchive Add ADD/COPY --chown flag support to Windows 2018-08-13 21:59:11 -07:00
containerfs Add ADD/COPY --chown flag support to Windows 2018-08-13 21:59:11 -07:00
devicemapper
directory
discovery
dmesg
filenotify pkg/filenotify/poller: fix Close() 2018-08-29 22:16:04 -07:00
fileutils Remove duplicated words in pkg files 2018-10-05 22:32:14 +08:00
fsutils
homedir
idtools Add ADD/COPY --chown flag support to Windows 2018-08-13 21:59:11 -07:00
ioutils Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
jsonmessage Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
locker
longpath
loopback
mount pkg/mount: wrap mount/umount errors 2018-12-10 20:07:02 -08:00
namesgenerator added an adjective to kick off another build! 2018-09-30 21:00:09 +01:00
parsers Fix denial of service with large numbers in cpuset-cpus and cpuset-mems 2018-10-05 15:09:02 +02:00
pidfile
platform
plugingetter Move plugin client to separate interface 2018-05-30 15:22:10 -04:00
plugins Remove duplicated words in pkg files 2018-10-05 22:32:14 +08:00
pools Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
progress pkg/progress: work around closing closed channel panic 2018-09-06 20:20:12 +00:00
pubsub
reexec fix build on OpenBSD by defining Self() 2018-06-16 19:09:04 +02:00
signal SIGSKTFLT does not exist on MIPS, instead SIGEMT does. SIGRTMAX is also 127 on MIPS. 2018-07-19 12:26:52 +02:00
stdcopy
streamformatter Remove duplicated words in pkg files 2018-10-05 22:32:14 +08:00
stringid
symlink Update LICENSE 2018-09-12 14:27:53 +01:00
sysinfo use empty string as cgroup path to grab first find 2018-12-07 18:44:00 +01:00
system pkg/system/stat_unix: wrap errors in PathError 2018-12-10 20:06:10 -08:00
tailfile Add func to get an io.Reader for tail operations 2018-08-10 21:01:15 -07:00
tarsum pkg/tarsum: fix unit test for Go 1.11+ 2018-07-19 10:38:45 +03:00
term Fix #28814 2018-08-07 10:20:13 +02:00
truncindex fixes display text in Multiple IDs found with provided prefix 2018-09-24 12:17:31 +08:00
urlutil Be explicit about github.com prefix being a legacy feature 2018-05-30 11:09:14 +02:00
useragent
README.md

pkg/ is a collection of utility packages used by the Moby project without being specific to its internals.

Utility packages are kept separate from the moby core codebase to keep it as small and concise as possible. If some utilities grow larger and their APIs stabilize, they may be moved to their own repository under the Moby organization, to facilitate re-use by other projects. However that is not the priority.

The directory pkg is named after the same directory in the camlistore project. Since Brad is a core Go maintainer, we thought it made sense to copy his methods for organizing Go code :) Thanks Brad!

Because utility packages are small and neatly separated from the rest of the codebase, they are a good place to start for aspiring maintainers and contributors. Get in touch if you want to help maintain them!