replace == by HasPrefix for names and improve error message

This commit is contained in:
Victor Vieux
2013-10-17 19:43:25 +00:00
parent 387aeb78fb
commit c4923757f1
3 changed files with 7 additions and 4 deletions
+3
View File
@@ -1088,6 +1088,9 @@ func postContainerLink(srv *Server, version float64, w http.ResponseWriter, r *h
}
if err := srv.runtime.RenameLink(currentName, newName); err != nil {
if strings.HasSuffix(err.Error(), "name are not unique") {
return fmt.Errorf("Conflict, %s already exists", newName)
}
return err
}