Merge pull request #992 from estesp/errrbody-likes-errrrors

Use error interfaces for content/metadata
This commit is contained in:
Michael Crosby
2017-06-21 11:55:11 -07:00
committed by GitHub
14 changed files with 254 additions and 70 deletions

View File

@@ -31,7 +31,7 @@ func (p dockerPusher) Push(ctx context.Context, desc ocispec.Descriptor) (conten
status, err := p.tracker.GetStatus(ref)
if err == nil {
if status.Offset == status.Total {
return nil, content.ErrExists
return nil, content.ErrExists("")
}
// TODO: Handle incomplete status
} else if !content.IsNotFound(err) {
@@ -72,7 +72,7 @@ func (p dockerPusher) Push(ctx context.Context, desc ocispec.Descriptor) (conten
// TODO: Set updated time?
},
})
return nil, content.ErrExists
return nil, content.ErrExists("")
}
if resp.StatusCode != http.StatusNotFound {
// TODO: log error

View File

@@ -34,7 +34,7 @@ func (t *memoryStatusTracker) GetStatus(ref string) (Status, error) {
defer t.m.Unlock()
status, ok := t.statuses[ref]
if !ok {
return Status{}, content.ErrNotFound
return Status{}, content.ErrNotFound("")
}
return status, nil
}