internal/proxyv2: improve error handling when configuring app

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-10-13 21:48:11 +02:00
parent cd42281383
commit 4d51ec906d
2 changed files with 15 additions and 9 deletions

View File

@ -24,8 +24,12 @@ func (ps *ProxyServer) Refresh() error {
hc := &http.Client{
Transport: ak.NewUserAgentTransport(constants.OutpostUserAgent()+ua, ak.NewTracingTransport(context.TODO(), ak.GetTLSTransport())),
}
a := application.NewApplication(provider, hc, ps.cryptoStore, ps.akAPI)
apps[a.Host] = a
a, err := application.NewApplication(provider, hc, ps.cryptoStore, ps.akAPI)
if err != nil {
ps.log.WithError(err).Warning("failed to setup application")
} else {
apps[a.Host] = a
}
}
ps.apps = apps
ps.log.Debug("Swapped maps")