forked from lix-project/lix
separate msgs instead of appending to what()
This commit is contained in:
parent
c05f0e3093
commit
9c5ece44a7
|
@ -298,23 +298,21 @@ int handleExceptions(const string & programName, std::function<void()> fun)
|
||||||
} catch (Exit & e) {
|
} catch (Exit & e) {
|
||||||
return e.status;
|
return e.status;
|
||||||
} catch (UsageError & e) {
|
} catch (UsageError & e) {
|
||||||
// TODO: switch to logError
|
logError(e.info());
|
||||||
// logError(e.info());
|
printError("Try '%1% --help' for more information.", programName);
|
||||||
_printError(
|
|
||||||
format("%1%\nTry '%2% --help' for more information.")
|
|
||||||
% e.what() % programName);
|
|
||||||
return 1;
|
return 1;
|
||||||
} catch (BaseError & e) {
|
} catch (BaseError & e) {
|
||||||
// logError(e.info());
|
if (settings.showTrace && e.prefix() != "")
|
||||||
_printError("%1%%2%", (settings.showTrace ? e.prefix() : ""), e.msg());
|
printError(e.prefix());
|
||||||
|
logError(e.info());
|
||||||
if (e.prefix() != "" && !settings.showTrace)
|
if (e.prefix() != "" && !settings.showTrace)
|
||||||
_printError("(use '--show-trace' to show detailed location information)");
|
printError("(use '--show-trace' to show detailed location information)");
|
||||||
return e.status;
|
return e.status;
|
||||||
} catch (std::bad_alloc & e) {
|
} catch (std::bad_alloc & e) {
|
||||||
_printError(error + "out of memory");
|
printError(error + "out of memory");
|
||||||
return 1;
|
return 1;
|
||||||
} catch (std::exception & e) {
|
} catch (std::exception & e) {
|
||||||
_printError(error + e.what());
|
printError(error + e.what());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue