Convert file not exists to status not found

Fixes message on pull about a statuses not being found.
These statuses can just be ignored since they are no
longer valid and holding the database lock while reading
statuses is not necessary.

Closes #1231

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan 2017-07-27 15:36:40 -07:00
parent d4349eff39
commit ccbb035231
No known key found for this signature in database
GPG Key ID: F58C5D0A4405ACDB

View File

@ -206,11 +206,17 @@ func (s *store) status(ingestPath string) (content.Status, error) {
dp := filepath.Join(ingestPath, "data")
fi, err := os.Stat(dp)
if err != nil {
if os.IsNotExist(err) {
err = errors.Wrap(errdefs.ErrNotFound, err.Error())
}
return content.Status{}, err
}
ref, err := readFileString(filepath.Join(ingestPath, "ref"))
if err != nil {
if os.IsNotExist(err) {
err = errors.Wrap(errdefs.ErrNotFound, err.Error())
}
return content.Status{}, err
}