From 68fb3ba88fc36982f583bd09189c3af4b0b00521 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 26 May 2018 13:07:03 +1000 Subject: Rework `fail` command not to display command call stack `fail` triggers "expected" errors, and hence should just display the provided message. --- src/command_manager.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/command_manager.cc') diff --git a/src/command_manager.cc b/src/command_manager.cc index 9cf0c805..94182f4d 100644 --- a/src/command_manager.cc +++ b/src/command_manager.cc @@ -425,10 +425,15 @@ void CommandManager::execute_single_command(CommandParameters params, command_it->value.param_desc); command_it->value.func(parameter_parser, context, shell_context); } + catch (failure& error) + { + throw; + } catch (runtime_error& error) { - throw runtime_error(format("{}:{}: '{}' {}", pos.line+1, pos.column+1, - params[0], error.what())); + error.set_what(format("{}:{}: '{}' {}", pos.line+1, pos.column+1, + params[0], error.what())); + throw; } } -- cgit v1.2.3