mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 17:57:19 +02:00
Fix error message printing
This commit is contained in:
parent
f44692d266
commit
5868b608cb
2 changed files with 8 additions and 6 deletions
|
@ -218,11 +218,11 @@ impl TaskwarriorTuiApp {
|
||||||
.output()
|
.output()
|
||||||
.context("Unable to run `task diagnostics`.")
|
.context("Unable to run `task diagnostics`.")
|
||||||
.unwrap();
|
.unwrap();
|
||||||
panic!(
|
return Err(anyhow!(
|
||||||
"Unable to run `task show`.\n{}\n{}\nPlease check your configuration or open a issue on github.",
|
"Unable to run `task show`.\n{}\n{}\nPlease check your configuration or open a issue on github.",
|
||||||
String::from_utf8_lossy(&output.stdout),
|
String::from_utf8_lossy(&output.stdout),
|
||||||
String::from_utf8_lossy(&output.stderr),
|
String::from_utf8_lossy(&output.stderr)
|
||||||
);
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
let data = String::from_utf8_lossy(&output.stdout);
|
let data = String::from_utf8_lossy(&output.stdout);
|
||||||
|
|
|
@ -59,9 +59,11 @@ fn main() {
|
||||||
|
|
||||||
let config = matches.value_of("config").unwrap_or("~/.taskrc");
|
let config = matches.value_of("config").unwrap_or("~/.taskrc");
|
||||||
let report = matches.value_of("report").unwrap_or("next");
|
let report = matches.value_of("report").unwrap_or("next");
|
||||||
task::block_on(tui_main(config, report)).expect(
|
let r = task::block_on(tui_main(config, report));
|
||||||
"[taskwarrior-tui error]. If you need additional help, please report as a github issue on https://github.com/kdheepak/taskwarrior-tui",
|
if let Err(err) = r {
|
||||||
);
|
eprintln!("\x1b[0;31m[taskwarrior-tui error]\x1b[0m: {}\n\nIf you need additional help, please report as a github issue on https://github.com/kdheepak/taskwarrior-tui", err);
|
||||||
|
std::process::exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn tui_main(_config: &str, report: &str) -> Result<()> {
|
async fn tui_main(_config: &str, report: &str) -> Result<()> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue