Merge pull request #651 from duglin/ErrArgs
Add ability to pass in substitution args into an Error
This commit is contained in:
commit
2b88cb9413
5 changed files with 111 additions and 40 deletions
|
@ -697,14 +697,14 @@ func TestManifestUnauthorized(t *testing.T) {
|
|||
if err == nil {
|
||||
t.Fatal("Expected error fetching manifest")
|
||||
}
|
||||
v2Err, ok := err.(*errcode.Error)
|
||||
v2Err, ok := err.(errcode.Error)
|
||||
if !ok {
|
||||
t.Fatalf("Unexpected error type: %#v", err)
|
||||
}
|
||||
if v2Err.Code != v2.ErrorCodeUnauthorized {
|
||||
t.Fatalf("Unexpected error code: %s", v2Err.Code.String())
|
||||
}
|
||||
if expected := errcode.ErrorCode(v2.ErrorCodeUnauthorized).Message(); v2Err.Message() != expected {
|
||||
t.Fatalf("Unexpected message value: %s, expected %s", v2Err.Message(), expected)
|
||||
if expected := v2.ErrorCodeUnauthorized.Message(); v2Err.Message != expected {
|
||||
t.Fatalf("Unexpected message value: %q, expected %q", v2Err.Message, expected)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue