keep: MockVolume should return os.ErrNotExist instead of errors.New("not
authorWard Vandewege <ward@curoverse.com>
Fri, 4 Jul 2014 02:29:18 +0000 (22:29 -0400)
committerWard Vandewege <ward@curoverse.com>
Fri, 4 Jul 2014 02:29:18 +0000 (22:29 -0400)
found") when a block can not be found, just like a real volume.

services/keep/src/keep/volume.go

index fffc815d90ddcb56c7cde97a75ecb6e751bb9673..d1956862b10d74d0da40fe7c8809f5bbdb863d4a 100644 (file)
@@ -8,6 +8,7 @@ import (
        "errors"
        "fmt"
        "strings"
+       "os"
 )
 
 type Volume interface {
@@ -38,7 +39,7 @@ func (v *MockVolume) Get(loc string) ([]byte, error) {
        } else if block, ok := v.Store[loc]; ok {
                return block, nil
        }
-       return nil, errors.New("not found")
+       return nil, os.ErrNotExist
 }
 
 func (v *MockVolume) Put(loc string, block []byte) error {