KindNotFound for all storages (#560)

* all exc mongo

* module, version associated with each storage error

* remove confusion

* removed formatted error in favor of raw flavor

* once more
This commit is contained in:
Michal Pristas
2018-08-24 20:00:00 +02:00
committed by GitHub
parent fa16c6950b
commit 539700e598
20 changed files with 94 additions and 39 deletions
+3 -3
View File
@@ -19,13 +19,13 @@ func (s *ModuleStore) Save(ctx context.Context, module, version string, mod []by
fs := s.s.DB(s.d).GridFS("fs")
f, err := fs.Create(zipName)
if err != nil {
return errors.E(op, err)
return errors.E(op, err, errors.M(module), errors.V(version))
}
defer f.Close()
_, err = io.Copy(f, zip) // check number of bytes written?
if err != nil {
return errors.E(op, err)
return errors.E(op, err, errors.M(module), errors.V(version))
}
m := &storage.Module{
@@ -38,7 +38,7 @@ func (s *ModuleStore) Save(ctx context.Context, module, version string, mod []by
c := s.s.DB(s.d).C(s.c)
err = c.Insert(m)
if err != nil {
return errors.E(op, err)
return errors.E(op, err, errors.M(module), errors.V(version))
}
return nil