Skip to content

Commit

Permalink
On failure, include errmsg in error
Browse files Browse the repository at this point in the history
For some commands, the "success" attribute is being included in the
returned error instead of errmsg.
  • Loading branch information
gstroz committed Jun 12, 2020
1 parent 01da0e0 commit d29e3b4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion loadCert.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (c *ClientConn) LoadCertificate(s string, typ string, flag string) (err err
}

if msg["success"] != "yes" {
return fmt.Errorf("unsuccessful loadCert: %v", msg["success"])
return fmt.Errorf("unsuccessful loadCert: %v", msg["errmsg"])
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion loadPrivateKey.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (c *ClientConn) loadPrivateKey(typ, data string) (err error) {

msg, err := c.Request("load-key", *requestMap)
if msg["success"] != "yes" {
return fmt.Errorf("unsuccessful loadPrivateKey: %v", msg["success"])
return fmt.Errorf("unsuccessful loadPrivateKey: %v", msg["errmsg"])
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion pools.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (c *ClientConn) LoadPool(ph Pool) error {
msg, err := c.Request("load-pool", requestMap)

if msg["success"] != "yes" {
return fmt.Errorf("unsuccessful LoadPool: %v", msg["success"])
return fmt.Errorf("unsuccessful LoadPool: %v", msg["errmsg"])
}

return nil
Expand Down

0 comments on commit d29e3b4

Please sign in to comment.