From ad34a716467464718990c207a123456cd36f89af Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 3 Feb 2009 00:45:14 -0400 Subject: Corrected a display error when showing error context. --- src/main.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main.cc') diff --git a/src/main.cc b/src/main.cc index 736893a4..9a1e903e 100644 --- a/src/main.cc +++ b/src/main.cc @@ -133,8 +133,12 @@ int main(int argc, char * argv[], char * envp[]) } catch (const std::exception& err) { std::cout.flush(); // first display anything that was pending - std::cerr << error_context() << std::endl - << "Error: " << err.what() << std::endl; + + string context = error_context(); + if (! context.empty()) + std::cerr << context << std::endl; + + std::cerr << "Error: " << err.what() << std::endl; } catch (int _status) { status = _status; // used for a "quick" exit, and is used only -- cgit v1.2.3