Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
REVIEW: use the title error in the final error message
◌ CI pending Fintan Halpenny committed 9 months ago
commit 726a395c606cc23779f2fa49844d0948b4bea561
parent d7af27794c86b767ebcc8f5b0ead45067efc122f
1 pending (1 total) View logs
1 file changed +4 -4
modified crates/radicle-cli/src/terminal/patch.rs
@@ -228,10 +228,10 @@ pub fn get_create_message(
    let (title, description) = message.split_once('\n').unwrap_or((&message, ""));
    let (title, description) = (title.trim().to_string(), description.trim().to_string());

-
    let title = Title::new(title.as_str()).map_err(|_| {
+
    let title = Title::new(title.as_str()).map_err(|err| {
        io::Error::new(
            io::ErrorKind::InvalidInput,
-
            "a patch title must be provided",
+
            format!("invalid patch title: {err}"),
        )
    })?;

@@ -259,10 +259,10 @@ pub fn get_edit_message(
        .unwrap_or((&patch_message, ""));
    let (title, description) = (title.trim().to_string(), description.trim().to_string());

-
    let title = Title::new(title.as_str()).map_err(|_| {
+
    let title = Title::new(title.as_str()).map_err(|err| {
        io::Error::new(
            io::ErrorKind::InvalidInput,
-
            "a patch title must be provided",
+
            format!("invalid patch title: {err}"),
        )
    })?;