containerd/content
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
..
content_test.go content: unify provider and ingester 2017-05-10 17:05:53 -07:00
content.go Use error interfaces for content/metadata 2017-06-14 15:55:08 -04:00
helpers.go errdefs: centralize error handling 2017-06-29 15:00:47 -07:00
locks.go errdefs: centralize error handling 2017-06-29 15:00:47 -07:00
readerat.go Add ReaderAt support to content store 2017-06-07 10:43:00 -07:00
store_linux.go Partial port to Darwin and FreeBSD 2017-05-04 18:11:53 +01:00
store_unix.go Partial port to Darwin and FreeBSD 2017-05-04 18:11:53 +01:00
store_windows.go Initial windows runtime work 2017-04-07 09:20:44 -07:00
store.go errdefs: centralize error handling 2017-06-29 15:00:47 -07:00
writer.go errdefs: centralize error handling 2017-06-29 15:00:47 -07:00