Don't push and pop reports unless at a REPL.

This commit is contained in:
John Wiegley 2009-02-06 23:38:51 -04:00
parent 234304e3a3
commit fdc8e401bf

View file

@ -219,9 +219,9 @@ int global_scope_t::execute_command_wrapper(strings_list args, bool at_repl)
int status = 1;
try {
push_report();
if (at_repl) push_report();
execute_command(args, at_repl);
pop_report();
if (at_repl) pop_report();
// If we've reached this point, everything succeeded fine. Ledger uses
// exceptions to notify of error conditions, so if you're using gdb,
@ -229,7 +229,7 @@ int global_scope_t::execute_command_wrapper(strings_list args, bool at_repl)
status = 0;
}
catch (const std::exception& err) {
pop_report();
if (at_repl) pop_report();
report_error(err);
}