From b61f803d60585f62451ed3d73fce62ea84e194d3 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 28 Nov 2014 06:28:07 +0100 Subject: [PATCH] Show source line information for the "repl" command refs #7805 --- lib/cli/replcommand.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/cli/replcommand.cpp b/lib/cli/replcommand.cpp index e22679c99..4409dc011 100644 --- a/lib/cli/replcommand.cpp +++ b/lib/cli/replcommand.cpp @@ -92,6 +92,14 @@ int ReplCommand::Run(const po::variables_map& vm, const std::vector std::cout << ConsoleColorTag(Console_Normal) << "\n"; } } catch (const ConfigError& ex) { + const DebugInfo *di = boost::get_error_info(ex); + + if (di) { + std::cout << String(3 + di->FirstColumn, ' '); + std::cout << String(di->LastColumn - di->FirstColumn + 1, '^'); + std::cout << "\n"; + } + std::cout << ex.what() << "\n"; } catch (const std::exception& ex) { std::cout << "Error: " << DiagnosticInformation(ex) << "\n"; -- 2.40.0