Commit a00f003a authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Emit better error message if scheme folder has wrong name

parent b6ed9ad0
Pipeline #20050 failed with stages
in 1 minute and 27 seconds
......@@ -267,14 +267,14 @@ func (conf *Configuration) ParseSchemeManagerFolder(dir string, manager *SchemeM
return
}
exists, err := conf.pathToDescription(manager, dir+"/description.xml", manager)
if !exists {
manager.Status = SchemeManagerStatusParsingError
return errors.New("Scheme manager description not found")
}
if err != nil {
manager.Status = SchemeManagerStatusParsingError
return
}
if !exists {
manager.Status = SchemeManagerStatusParsingError
return errors.New("Scheme manager description not found")
}
if err = conf.checkScheme(manager, dir); err != nil {
return
}
......@@ -637,7 +637,11 @@ func (conf *Configuration) pathToDescription(manager *SchemeManager, path string
}
bts, found, err := conf.ReadAuthenticatedFile(manager, relativepath)
if !found {
return false, nil
for p := range manager.index {
expectedName := p[0:strings.Index(p, "/")]
return false, errors.Errorf("Folder must be called %s, not %s", expectedName, manager.ID)
}
return false, errors.New("")
}
if err != nil {
return true, err
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment