mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
commands: Improved option conversin error message
This commit is contained in:
parent
d1c50972f5
commit
5e16dfb111
@ -223,8 +223,12 @@ func (r *request) ConvertOptions() error {
|
||||
}
|
||||
val, err := convert(str)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Could not convert string value '%s' to type '%s'",
|
||||
v, opt.Type.String())
|
||||
value := fmt.Sprintf("value '%v'", v)
|
||||
if len(str) == 0 {
|
||||
value = "empty value"
|
||||
}
|
||||
return fmt.Errorf("Could not convert %s to type '%s' (for option '-%s')",
|
||||
value, opt.Type.String(), k)
|
||||
}
|
||||
r.options[k] = val
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user