mu: improve error reporting

This commit is contained in:
Dirk-Jan C. Binnema
2022-05-15 13:40:44 +03:00
parent f2c0af7413
commit 6e37790012
4 changed files with 7 additions and 10 deletions

View File

@ -57,7 +57,7 @@ handle_result(const Result<void>& res, MuConfig* conf)
if (!res.error().is_soft_error()) {
std::cerr << col.fg(Color::Red) << "error" << col.reset() << ": "
<< col.fg(Color::BrightYellow)
<< res.error().what() << "something went wrong" << "\n";
<< res.error().what() << "\n";
} else
std::cerr << col.fg(Color::BrightBlue) << res.error().what() << '\n';
@ -69,6 +69,9 @@ handle_result(const Result<void>& res, MuConfig* conf)
if (conf && mu_config_cmd_is_valid(conf->cmd))
mu_config_show_help(conf->cmd);
break;
case Error::Code::StoreLock:
std::cerr << "Perhaps mu is already running?\n";
break;
case Error::Code::SchemaMismatch:
std::cerr << "Please (re)initialize mu with 'mu init' "
<< "see mu-init(1) for details\n";