Print command errors instead of unwrapping

This commit is contained in:
mars 2022-09-20 05:44:26 -06:00
parent 68fd63eaff
commit 247028caa8
1 changed files with 6 additions and 1 deletions

View File

@ -101,7 +101,12 @@ impl NodeEditor {
};
if let Some(cmd) = cmd {
self.cmd_history.push(&mut self.graph, cmd).unwrap();
let cmd_debug = format!("{:#?}", cmd);
match self.cmd_history.push(&mut self.graph, cmd) {
Ok(_) => {},
Err(e) => eprintln!("{}:\n {:#?}", cmd_debug, e),
}
}
self.pointer_state.action = PointerAction::Idle(None); // TODO idle pointer targeting