diff --git a/lib/utils/mu-error.hh b/lib/utils/mu-error.hh index c038719f..8bf332e1 100644 --- a/lib/utils/mu-error.hh +++ b/lib/utils/mu-error.hh @@ -189,7 +189,10 @@ private: static inline auto format_as(const Error& err) { - return mu_format("<{} ({})>", err.what(), Error::error_number(err.code())); + return mu_format("<{} ({}:{})>", + err.what(), + Error::error_number(err.code()), + err.exit_code()); } } // namespace Mu diff --git a/mu/mu.cc b/mu/mu.cc index da47b73f..847cd261 100644 --- a/mu/mu.cc +++ b/mu/mu.cc @@ -67,6 +67,9 @@ handle_result(const Result& res, const Mu::Options& opts) col.fg(Color::Blue), col.reset(), col.fg(Color::Green), res.error().hint(), col.reset()); + if (res.error().exit_code() != 0 && !res.error().is_soft_error()) + mu_warning("mu finishing with error: {}", format_as(res.error())); + return res.error().exit_code(); }