diff options
author | Brian Goff <cpuguy83@gmail.com> | 2017-07-19 10:20:13 -0400 |
---|---|---|
committer | Brian Goff <cpuguy83@gmail.com> | 2017-08-15 16:01:11 -0400 |
commit | ebcb7d6b406fe50ea9a237c73004d75884184c33 (patch) | |
tree | c87316ace5b2ddc5efabeb311d47e98fd4113ce9 /runconfig/config_test.go | |
parent | b6498340b2baa6596553b2b56b43990a365a7b6a (diff) | |
download | docker-ebcb7d6b406fe50ea9a237c73004d75884184c33.tar.gz |
Remove string checking in API error handling
Use strongly typed errors to set HTTP status codes.
Error interfaces are defined in the api/errors package and errors
returned from controllers are checked against these interfaces.
Errors can be wraeped in a pkg/errors.Causer, as long as somewhere in the
line of causes one of the interfaces is implemented. The special error
interfaces take precedence over Causer, meaning if both Causer and one
of the new error interfaces are implemented, the Causer is not
traversed.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Diffstat (limited to 'runconfig/config_test.go')
-rw-r--r-- | runconfig/config_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runconfig/config_test.go b/runconfig/config_test.go index 83ec363a0b..231b4509bc 100644 --- a/runconfig/config_test.go +++ b/runconfig/config_test.go @@ -51,7 +51,7 @@ func TestDecodeContainerConfig(t *testing.T) { t.Fatal(err) } - c, h, _, err := DecodeContainerConfig(bytes.NewReader(b)) + c, h, _, err := decodeContainerConfig(bytes.NewReader(b)) if err != nil { t.Fatal(fmt.Errorf("Error parsing %s: %v", f, err)) } @@ -135,5 +135,5 @@ func callDecodeContainerConfigIsolation(isolation string) (*container.Config, *c if b, err = json.Marshal(w); err != nil { return nil, nil, nil, fmt.Errorf("Error on marshal %s", err.Error()) } - return DecodeContainerConfig(bytes.NewReader(b)) + return decodeContainerConfig(bytes.NewReader(b)) } |