Don't error out on plugin err with json
We don't want to error out when there is a json unmarshal error since the `old way` will cause this to error. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
390876ba18
commit
486bca6d94
1 changed files with 4 additions and 5 deletions
|
@ -134,11 +134,10 @@ func (c *Client) callWithRetry(serviceMethod string, data io.Reader, retry bool)
|
||||||
Err string
|
Err string
|
||||||
}
|
}
|
||||||
remoteErr := responseErr{}
|
remoteErr := responseErr{}
|
||||||
if err := json.Unmarshal(b, &remoteErr); err != nil {
|
if err := json.Unmarshal(b, &remoteErr); err == nil {
|
||||||
return nil, fmt.Errorf("%s: %s", serviceMethod, err)
|
if remoteErr.Err != "" {
|
||||||
}
|
return nil, fmt.Errorf("%s: %s", serviceMethod, remoteErr.Err)
|
||||||
if remoteErr.Err != "" {
|
}
|
||||||
return nil, fmt.Errorf("%s: %s", serviceMethod, remoteErr.Err)
|
|
||||||
}
|
}
|
||||||
// old way...
|
// old way...
|
||||||
return nil, fmt.Errorf("%s: %s", serviceMethod, string(b))
|
return nil, fmt.Errorf("%s: %s", serviceMethod, string(b))
|
||||||
|
|
Loading…
Reference in a new issue