Move ErrorCode logic to new errcode package
Make HTTP status codes match the ErrorCode by looking it up in the Descriptors Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
parent
5f553b3cfc
commit
f565d6abb7
16 changed files with 444 additions and 405 deletions
|
@ -18,6 +18,7 @@ import (
|
|||
"github.com/docker/distribution/context"
|
||||
"github.com/docker/distribution/digest"
|
||||
"github.com/docker/distribution/manifest"
|
||||
"github.com/docker/distribution/registry/api/errcode"
|
||||
"github.com/docker/distribution/registry/api/v2"
|
||||
"github.com/docker/distribution/testutil"
|
||||
)
|
||||
|
@ -668,7 +669,7 @@ func TestManifestUnauthorized(t *testing.T) {
|
|||
if err == nil {
|
||||
t.Fatal("Expected error fetching manifest")
|
||||
}
|
||||
v2Err, ok := err.(*v2.Error)
|
||||
v2Err, ok := err.(*errcode.Error)
|
||||
if !ok {
|
||||
t.Fatalf("Unexpected error type: %#v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue