Skip to content

Commit

Permalink
server/vault: tweak error messages
Browse files Browse the repository at this point in the history
Closes #5139
  • Loading branch information
Mahmood Ali committed Jan 23, 2019
1 parent 7e81a9e commit 2f0b11f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nomad/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ OUTER:
retryTimer.Reset(v.config.ConnectionRetryIntv)
v.l.Lock()
v.connEstablished = true
v.connEstablishedErr = fmt.Errorf("Nomad Server failed to establish connections to Vault: %v", err)
v.connEstablishedErr = fmt.Errorf("failed to establish connections to Vault: %v", err)
v.l.Unlock()
continue OUTER
}
Expand Down Expand Up @@ -517,7 +517,8 @@ func (v *vaultClient) renewalLoop() {
if backoff < 0 {
// We have failed to renew the token past its expiration. Stop
// renewing with Vault.
v.logger.Error("failed to renew Vault token before lease expiration. Shutting down Vault client")
v.logger.Error("failed to renew Vault token before lease expiration. Shutting down Vault client",
"error", err)
v.l.Lock()
v.connEstablished = false
v.connEstablishedErr = err
Expand Down Expand Up @@ -905,7 +906,7 @@ func (v *vaultClient) CreateToken(ctx context.Context, a *structs.Allocation, ta
if established, err := v.ConnectionEstablished(); !established && err == nil {
return nil, structs.NewRecoverableError(fmt.Errorf("Connection to Vault has not been established"), true)
} else if err != nil {
return nil, err
return nil, fmt.Errorf("failed to establish connection to Vault", err)
}

// Track how long the request takes
Expand Down

0 comments on commit 2f0b11f

Please sign in to comment.