[#683] cli: Add context to policy parsing errors
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
3c76884182
commit
58239d1b2c
1 changed files with 2 additions and 2 deletions
|
@ -185,12 +185,12 @@ func parseContainerPolicy(cmd *cobra.Command, policyString string) (*netmap.Plac
|
|||
return &result, nil
|
||||
}
|
||||
|
||||
if err = result.UnmarshalJSON([]byte(policyString)); err == nil {
|
||||
if err := result.UnmarshalJSON([]byte(policyString)); err == nil {
|
||||
common.PrintVerbose(cmd, "Parsed JSON encoded policy")
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
return nil, errors.New("can't parse placement policy")
|
||||
return nil, fmt.Errorf("can't parse placement policy: %w", err)
|
||||
}
|
||||
|
||||
func parseAttributes(dst *container.Container, attributes []string) error {
|
||||
|
|
Loading…
Reference in a new issue