From 528c6c91ef52b2ce0e1f29bc425cf988de5f6fdb Mon Sep 17 00:00:00 2001 From: Connor Edwards <38229097+cedws@users.noreply.github.com> Date: Sat, 15 Oct 2022 17:08:15 +0100 Subject: [PATCH] Don't log if alt client leveldbs are not found --- client/token/token.go | 2 +- client/token/token_darwin.go | 6 ++++-- client/token/token_windows.go | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/client/token/token.go b/client/token/token.go index daf534f..5694416 100644 --- a/client/token/token.go +++ b/client/token/token.go @@ -36,7 +36,7 @@ func getSafeStorageTokens(path string) (SafeStorageTokens, error) { ReadOnly: true, }) if err != nil { - return nil, fmt.Errorf("tokens: error opening database: %w", err) + return nil, fmt.Errorf("token: error opening database: %w", err) } defer db.Close() diff --git a/client/token/token_darwin.go b/client/token/token_darwin.go index 698f200..d229f4f 100644 --- a/client/token/token_darwin.go +++ b/client/token/token_darwin.go @@ -6,6 +6,7 @@ import ( "crypto/cipher" "crypto/sha1" "encoding/base64" + "errors" "fmt" "os" "path/filepath" @@ -33,8 +34,9 @@ func GetToken() (string, error) { safeTokens, err := getSafeStorageTokens(path) if err != nil { - // try another database - log.Error(err) + if !errors.Is(err, os.ErrNotExist) { + log.Error(err) + } continue } diff --git a/client/token/token_windows.go b/client/token/token_windows.go index 35d2e35..3a92056 100644 --- a/client/token/token_windows.go +++ b/client/token/token_windows.go @@ -5,6 +5,7 @@ import ( "crypto/cipher" "encoding/base64" "encoding/json" + "errors" "fmt" "os" "path/filepath" @@ -37,8 +38,9 @@ func GetToken() (string, error) { safeTokens, err := getSafeStorageTokens(path) if err != nil { - // try another database - log.Error(err) + if !errors.Is(err, os.ErrNotExist) { + log.Error(err) + } continue }