1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/api/server
Brian Goff 87a12421a9 Add helpers to create errdef errors
Instead of having to create a bunch of custom error types that are doing
nothing but wrapping another error in sub-packages, use a common helper
to create errors of the requested type.

e.g. instead of re-implementing this over and over:

```go
type notFoundError struct {
  cause error
}

func(e notFoundError) Error() string {
  return e.cause.Error()
}

func(e notFoundError) NotFound() {}

func(e notFoundError) Cause() error {
  return e.cause
}
```

Packages can instead just do:

```
  errdefs.NotFound(err)
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-01-11 21:21:43 -05:00
..
backend/build return prune data when context canceled 2017-07-10 10:06:24 +08:00
httputils Add helpers to create errdef errors 2018-01-11 21:21:43 -05:00
middleware Always return version and server headers 2017-10-11 22:06:43 +02:00
router Add helpers to create errdef errors 2018-01-11 21:21:43 -05:00
middleware.go Update logrus to v1.0.1 2017-07-31 13:16:46 -07:00
router_swapper.go fix typos 2016-03-06 00:59:11 +08:00
server.go Remove deprecated --enable-api-cors flag 2017-09-12 12:43:34 +02:00
server_test.go Correct fmt.Fprintf and t.Fatalf 2017-02-08 12:32:40 +08:00