Return the err from server correctly

This commit is contained in:
Preetha Appan
2018-03-13 18:10:14 -05:00
parent 25b338b2a8
commit f4a4685d84

View File

@@ -1754,7 +1754,7 @@ func (c *Client) deriveToken(alloc *structs.Allocation, taskNames []string, vcli
var resp structs.DeriveVaultTokenResponse
if err := c.RPC("Node.DeriveVaultToken", &req, &resp); err != nil {
c.logger.Printf("[ERR] client.vault: DeriveVaultToken RPC failed: %v", err)
return nil, structs.NewWrappedServerError(resp.Error)
return nil, structs.NewWrappedServerError(err)
}
if resp.Error != nil {
c.logger.Printf("[ERR] client.vault: failed to derive vault tokens: %v", resp.Error)