fix: friendly tip for initial logging in [skip ci] (#3406)

* refactor: friendly tip for initial logging in

* fix CodeFactor issue

more info pls refer to: https://segmentfault.com/a/1190000043031147
pull/3495/head
仝华帅 2023-02-18 17:53:11 +08:00 committed by GitHub
parent fcaf485e0b
commit ee77c3b113
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -15,6 +15,10 @@ func GetStorageAndActualPath(rawPath string) (storage driver.Driver, actualPath
rawPath = utils.FixAndCleanPath(rawPath)
storage = GetBalancedStorage(rawPath)
if storage == nil {
if rawPath == "/" {
err = errors.New("please add a storage first.")
return
}
err = errors.Errorf("can't find storage with rawPath: %s", rawPath)
return
}