Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli: Better error message in `rad id`
cloudhead committed 2 years ago
commit 0d18a8fd9e37ca9d5e9dc01566ce4debd16b2a0d
parent e06dd208f4b5728c25ebe1b97b9fe7d034d4be7a
1 file changed +3 -1
modified radicle-cli/src/commands/id.rs
@@ -194,7 +194,9 @@ impl Args for Options {
                    let val = values
                        .next()
                        .ok_or(anyhow!("expected payload value, eg. '\"heartwood\"'"))?;
-
                    let val = json::from_str(val.to_string_lossy().to_string().as_str())?;
+
                    let val = val.to_string_lossy().to_string();
+
                    let val = json::from_str(val.as_str())
+
                        .map_err(|e| anyhow!("invalid JSON value `{val}`: {e}"))?;

                    payload.push((id, key, val));
                }