diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2024-03-07 12:19:30 +0100 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2024-03-07 12:19:30 +0100 |
| commit | 274a0f55134f42a97e87b93a50e26bb1f14a1299 (patch) | |
| tree | 4d684012d7f660523881e135ac15ab4070931aaf /internal/discovery/discovery.go | |
| parent | 7b708040dd56c413ecfe9d7685260ad88373dbc3 (diff) | |
Discovery: Resolve logging TODOs
Diffstat (limited to 'internal/discovery/discovery.go')
| -rw-r--r-- | internal/discovery/discovery.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/internal/discovery/discovery.go b/internal/discovery/discovery.go index 6db9425..469fff0 100644 --- a/internal/discovery/discovery.go +++ b/internal/discovery/discovery.go @@ -8,6 +8,7 @@ import ( "time" "github.com/eduvpn/eduvpn-common/internal/http" + "github.com/eduvpn/eduvpn-common/internal/log" "github.com/eduvpn/eduvpn-common/internal/verify" discotypes "github.com/eduvpn/eduvpn-common/types/discovery" ) @@ -230,8 +231,10 @@ func (discovery *Discovery) Organizations(ctx context.Context) (*discotypes.Orga err := discovery.file(ctx, file, discovery.OrganizationList.Version, &discovery.OrganizationList) if err != nil { // Return previous with an error - // TODO: Log here if we fail to get previous - orgs, _ := discovery.previousOrganizations() + orgs, perr := discovery.previousOrganizations() + if perr != nil { + log.Logger.Warningf("failed to get previous discovery organizations: %v", perr) + } return orgs, err } discovery.OrganizationList.Timestamp = time.Now() @@ -249,7 +252,10 @@ func (discovery *Discovery) Servers(ctx context.Context) (*discotypes.Servers, e if err != nil { // Return previous with an error // TODO: Log here if we fail to get previous - srvs, _ := discovery.previousServers() + srvs, perr := discovery.previousServers() + if perr != nil { + log.Logger.Warningf("failed to get previous discovery servers: %v", perr) + } return srvs, err } // Update servers timestamp |
