mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-18 06:29:42 +02:00
chore: better error message
This commit is contained in:
@@ -80,8 +80,11 @@ func (p *DockerProvider) loadRoutesImpl() (route.Routes, gperr.Error) {
|
||||
errs.Add(err.Subject(container.ContainerName))
|
||||
}
|
||||
for k, v := range newEntries {
|
||||
if routes.Contains(k) {
|
||||
errs.Addf("duplicated alias %s", k)
|
||||
if conflict, ok := routes[k]; ok {
|
||||
errs.Add(gperr.Multiline().
|
||||
Addf("route with alias %s already exists", k).
|
||||
Addf("container %s", container.ContainerName).
|
||||
Addf("conflicting container %s", conflict.Container.ContainerName))
|
||||
} else {
|
||||
routes[k] = v
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user