mirror of
https://github.com/yusing/godoxy.git
synced 2025-06-15 06:26:47 +02:00
tweak(docker): add hint when specified network not found
This commit is contained in:
parent
4825f768f3
commit
cabb840a91
1 changed files with 3 additions and 1 deletions
|
@ -13,6 +13,7 @@ import (
|
|||
"github.com/docker/go-connections/nat"
|
||||
"github.com/yusing/go-proxy/agent/pkg/agent"
|
||||
config "github.com/yusing/go-proxy/internal/config/types"
|
||||
"github.com/yusing/go-proxy/internal/gperr"
|
||||
idlewatcher "github.com/yusing/go-proxy/internal/idlewatcher/types"
|
||||
"github.com/yusing/go-proxy/internal/serialization"
|
||||
"github.com/yusing/go-proxy/internal/utils"
|
||||
|
@ -247,7 +248,8 @@ func (c *Container) setPrivateHostname(helper containerHelper) {
|
|||
}
|
||||
}
|
||||
}
|
||||
c.addError(fmt.Errorf("%w: %s", ErrNetworkNotFound, c.Network))
|
||||
nearest := gperr.DoYouMean(utils.NearestField(c.Network, helper.NetworkSettings.Networks))
|
||||
c.addError(fmt.Errorf("network %q not found, %w", c.Network, nearest))
|
||||
return
|
||||
}
|
||||
// fallback to first network if no network is specified
|
||||
|
|
Loading…
Add table
Reference in a new issue