Skip to content

Commit

Permalink
Fix return errors from boltdb Get/Delete requests
Browse files Browse the repository at this point in the history
The return error of get and pull requests agains a boltdb instance was
assumed to never return an error and ignored those. This was fixed by
returning the error from the corresponding boltdb Get/Delete call.
  • Loading branch information
Daniel Hauenstein committed Feb 19, 2016
1 parent 3284daf commit dbf78af
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions store.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ func (s *Store) put(key []byte, b interface{}) (err error) {
if err != nil {
return err
}
objects.Put(key, data)
return nil
return objects.Put(key, data)
})
}

Expand Down Expand Up @@ -132,8 +131,7 @@ func (s *Store) pull(key []byte, b interface{}) error {
}

buf.Write(data)
objects.Delete(key)
return nil
return objects.Delete(key)
})

if err != nil {
Expand Down

0 comments on commit dbf78af

Please sign in to comment.