From 97c9b2b49f94735c6d4d5b62b772089ef7e0e3bf Mon Sep 17 00:00:00 2001 From: Ward Vandewege Date: Tue, 1 Jul 2014 22:12:34 -0400 Subject: [PATCH] Do not print an error when hitting 'not found' with a the MockVolume backend. --- services/keep/src/keep/keep.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/keep/src/keep/keep.go b/services/keep/src/keep/keep.go index 7d86202301..c9047b070f 100644 --- a/services/keep/src/keep/keep.go +++ b/services/keep/src/keep/keep.go @@ -575,12 +575,13 @@ func GetBlock(hash string) ([]byte, error) { for _, vol := range KeepVM.Volumes() { if buf, err := vol.Get(hash); err != nil { // IsNotExist is an expected error and may be ignored. + // "not found" is the equivalent for the MockVolume backend. // (If all volumes report IsNotExist, we return a NotFoundError) // A CorruptError should be returned immediately. // Any other errors should be logged but we continue trying to // read. switch { - case os.IsNotExist(err): + case (os.IsNotExist(err) || err.Error() == "not found"): continue default: log.Printf("GetBlock: reading %s: %s\n", hash, err) -- 2.30.2