From fdc8e401bf9f342c42cef52eeb5b5e566ac09197 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 6 Feb 2009 23:38:51 -0400 Subject: Don't push and pop reports unless at a REPL. --- src/global.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/global.cc b/src/global.cc index 36614c14..9dc4c647 100644 --- a/src/global.cc +++ b/src/global.cc @@ -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); } -- cgit v1.2.3