storage: fix error message (#2270)

* storage: add error message
This commit is contained in:
tattsun 2016-12-10 07:36:27 +09:00 committed by Brian Brazil
parent 9ecea36ef9
commit e714079cf2
1 changed files with 5 additions and 1 deletions

View File

@ -154,7 +154,11 @@ func newPersistence(
// empty. If not, we have found an old storage directory without
// version file, so we have to bail out.
if err := os.MkdirAll(basePath, 0700); err != nil {
return nil, err
if abspath, e := filepath.Abs(basePath); e != nil {
return nil, fmt.Errorf("cannot create persistent directory %s: %s", basePath, err)
} else {
return nil, fmt.Errorf("cannot create persistent directory %s: %s", abspath, err)
}
}
fis, err := ioutil.ReadDir(basePath)
if err != nil {