Skip to content

Commit

Permalink
Merge pull request #129 from SuperSandro2000/more-error-handling
Browse files Browse the repository at this point in the history
Fix more error handling
  • Loading branch information
quexten committed Mar 3, 2024
2 parents bb59756 + 886b7f6 commit 60abbb0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion agent/actions/login.go
Expand Up @@ -34,7 +34,8 @@ func handleLogin(msg messages.IPCMessage, cfg *config.Config, vault *vault.Vault
var masterKey crypto.MasterKey
var masterpasswordHash string

if secret, err := cfg.GetClientSecret(); err == nil && secret != "" {
var secret string // don't shadow err in the next line
if secret, err = cfg.GetClientSecret(); err == nil && secret != "" {
actionsLog.Info("Logging in with client secret")
token, masterKey, masterpasswordHash, err = bitwarden.LoginWithApiKey(ctx, req.Email, cfg, vault)
} else if req.Passwordless {
Expand Down
4 changes: 2 additions & 2 deletions agent/vault/vault.go
Expand Up @@ -149,9 +149,9 @@ func (vault *Vault) isSSHKey(cipher models.Cipher) bool {
cipherID := cipher.ID.String()
if cipher.OrganizationID != nil {
orgID := cipher.OrganizationID.String()
vaultLog.Error("Failed to decrypt field name with on cipher "+cipherID+" in organization "+orgID, err.Error())
vaultLog.Error("Failed to decrypt field name with on cipher %s in organization %s: %s", cipherID, orgID, err.Error())
} else {
vaultLog.Error("Failed to decrypt field name with on cipher "+cipherID, err.Error())
vaultLog.Error("Failed to decrypt field name with on cipher %s: %s", cipherID, err.Error())
}
continue
}
Expand Down

0 comments on commit 60abbb0

Please sign in to comment.