containerd/cmd/ctr
Stephen J Day a4fadc596b
errdefs: centralize error handling
Now that we have most of the services required for use with containerd,
it was found that common patterns were used throughout services. By
defining a central `errdefs` package, we ensure that services will map
errors to and from grpc consistently and cleanly. One can decorate an
error with as much context as necessary, using `pkg/errors` and still
have the error mapped correctly via grpc.

We make a few sacrifices. At this point, the common errors we use across
the repository all map directly to grpc error codes. While this seems
positively crazy, it actually works out quite well. The error conditions
that were specific weren't super necessary and the ones that were
necessary now simply have better context information. We lose the
ability to add new codes, but this constraint may not be a bad thing.

Effectively, as long as one uses the errors defined in `errdefs`, the
error class will be mapped correctly across the grpc boundary and
everything will be good. If you don't use those definitions, the error
maps to "unknown" and the error message is preserved.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-06-29 15:00:47 -07:00
..
attach.go Add ctr attach for reattaching to running task 2017-06-09 10:10:39 -07:00
checkpoint.go Add 'ArgsUsage' for some ctr sub-cmds 2017-06-15 16:04:11 +08:00
delete.go Fix ctr delete to remove snapshot 2017-06-26 13:38:08 -07:00
events.go events: move types into service package 2017-06-22 19:12:25 -07:00
exec.go Update runc and runtime-spec dependencies 2017-06-27 11:44:38 -07:00
info.go Add 'ArgsUsage' for some ctr sub-cmds 2017-06-15 16:04:11 +08:00
kill.go Add 'ArgsUsage' for some ctr sub-cmds 2017-06-15 16:04:11 +08:00
list.go Runtime name printed correctly. 2017-06-26 11:46:32 +09:00
main_unix.go Initial windows runtime work 2017-04-07 09:20:44 -07:00
main.go Merge pull request #935 from kunalkushwaha/ctr-fix-914 2017-06-23 13:16:07 -07:00
namespaces.go errdefs: centralize error handling 2017-06-29 15:00:47 -07:00
pause.go Port ctr to use client 2017-06-06 14:53:50 -07:00
pprof.go Fix the description of cmd 'pprof threadcreate' 2017-05-27 13:42:16 +08:00
ps.go Add 'ArgsUsage' for some ctr sub-cmds 2017-06-15 16:04:11 +08:00
resume.go Port ctr to use client 2017-06-06 14:53:50 -07:00
run_unix.go Port ctr to use client 2017-06-06 14:53:50 -07:00
run_windows.go Update windows and darwin for spec changes 2017-06-27 13:20:55 -07:00
run.go ctr: Properly delete snapshot if run is called with --rm 2017-06-23 18:01:01 -07:00
shim.go containerd-shim: Use abstract namespace for the unix socket 2017-06-23 17:48:08 -07:00
signals_linux.go Partial port to Darwin and FreeBSD 2017-05-04 18:11:53 +01:00
signals_unix.go Partial port to Darwin and FreeBSD 2017-05-04 18:11:53 +01:00
snapshot.go ctr: add remove subcommand to snapshot 2017-06-23 18:24:46 -07:00
utils_unix.go prepareStdio: use named return for err 2017-05-24 15:34:39 +01:00
utils_windows.go forward all signals to the container 2017-04-22 01:46:57 +03:00
utils.go *: update import paths to use versioned services 2017-06-21 18:29:06 -07:00
version.go Port ctr to use client 2017-06-06 14:53:50 -07:00