1
0
Fork 0

[Command] Print parse error and return default

This commit is contained in:
Florian RICHER 2023-03-13 20:00:38 +01:00
parent 766b20a5c0
commit ede680ee00

View file

@ -22,7 +22,13 @@ impl Into<std::process::Command> for Command {
impl From<&str> for Command {
fn from(value: &str) -> Self {
serde_json::from_str(value).unwrap_or_default()
match serde_json::from_str(value) {
Ok(command) => command,
Err(e) => {
eprintln!("[ERROR] {e}");
Command::default()
}
}
}
}