mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 08:47:18 +02:00
Add result check in main
This commit is contained in:
parent
670703dd42
commit
558c176862
1 changed files with 17 additions and 1 deletions
18
src/main.rs
18
src/main.rs
|
@ -49,7 +49,23 @@ fn main() -> Result<()> {
|
|||
.get_matches();
|
||||
|
||||
let config = matches.value_of("config").unwrap_or("~/.taskrc");
|
||||
task::block_on(tui_main(config))
|
||||
let r = task::block_on(tui_main(config));
|
||||
match r {
|
||||
Ok(_) => std::process::exit(0),
|
||||
Err(error) => {
|
||||
if error.to_string().to_lowercase().contains("no such file or directory") {
|
||||
eprintln!(
|
||||
"[taskwarrior-tui error]: Unable to find executable `task`: {}. Check that taskwarrior is installed correctly and try again.", error
|
||||
);
|
||||
} else {
|
||||
eprintln!(
|
||||
"[taskwarrior-tui error]: {}. Please report as a github issue on https://github.com/kdheepak/taskwarrior-tui",
|
||||
error
|
||||
);
|
||||
}
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async fn tui_main(_config: &str) -> Result<()> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue