Merge pull request #992 from estesp/errrbody-likes-errrrors
Use error interfaces for content/metadata
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user