Use error interfaces for content/metadata
These interfaces allow us to preserve both the checking of error "cause" as well as messages returned from the gRPC API so that the client gets full error reason instead of a default "metadata: not found" in the case of a missing image. Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
package content
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// Handles locking references
|
||||
@@ -20,7 +19,7 @@ func tryLock(ref string) error {
|
||||
defer locksMu.Unlock()
|
||||
|
||||
if _, ok := locks[ref]; ok {
|
||||
return errors.Wrapf(ErrLocked, "key %s is locked", ref)
|
||||
return ErrLocked(fmt.Sprintf("key %s is locked", ref))
|
||||
}
|
||||
|
||||
locks[ref] = struct{}{}
|
||||
|
Reference in New Issue
Block a user