Merge pull request #19131 from cpuguy83/fix_plugin_error_handling
Don't error out on plugin err with json
This commit is contained in:
commit
f4f848b7a5
|
@ -134,12 +134,11 @@ 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 != "" {
|
if remoteErr.Err != "" {
|
||||||
return nil, fmt.Errorf("%s: %s", serviceMethod, 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 New Issue