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 }