summaryrefslogtreecommitdiff
path: root/internal/server/custom.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-03-13 16:37:24 +0100
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2024-03-13 16:37:24 +0100
commit44a06427f1d3a5c088f9c0dc0ec813a5db227888 (patch)
tree3f1ced7444b647553d67e2c5a3901abc2e6eee52 /internal/server/custom.go
parenta92f6888bec213ed81c327ac24461266ac0b420b (diff)
Server: Log on remove after failed authorization error
Diffstat (limited to 'internal/server/custom.go')
-rw-r--r--internal/server/custom.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/server/custom.go b/internal/server/custom.go
index d2679cf..a35cbab 100644
--- a/internal/server/custom.go
+++ b/internal/server/custom.go
@@ -5,6 +5,7 @@ import (
"github.com/eduvpn/eduvpn-common/internal/api"
"github.com/eduvpn/eduvpn-common/internal/config/v2"
+ "github.com/eduvpn/eduvpn-common/internal/log"
"github.com/eduvpn/eduvpn-common/types/server"
"github.com/jwijenbergh/eduoauth-go"
)
@@ -35,7 +36,10 @@ func (s *Servers) AddCustom(ctx context.Context, id string, na bool) error {
_, err = api.NewAPI(ctx, s.clientID, sd, s.cb, nil)
if err != nil {
// authorization has failed, remove the server again
- s.config.RemoveServer(id, server.TypeCustom)
+ rerr := s.config.RemoveServer(id, server.TypeCustom)
+ if rerr != nil {
+ log.Logger.Warningf("could not remove custom server: '%s' after failing authorization: %v", id, rerr)
+ }
return err
}
return nil