From 3a062a9eafbcff348f322177c536bdfc12546b30 Mon Sep 17 00:00:00 2001 From: Stephane Del Pino <stephane.delpino44@gmail.com> Date: Mon, 29 Jun 2020 16:16:07 +0200 Subject: [PATCH] Do not catch exceptions when '-p' is used --- .../node_processor/BuiltinFunctionProcessor.hpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/language/node_processor/BuiltinFunctionProcessor.hpp b/src/language/node_processor/BuiltinFunctionProcessor.hpp index 61150be71..755680f5f 100644 --- a/src/language/node_processor/BuiltinFunctionProcessor.hpp +++ b/src/language/node_processor/BuiltinFunctionProcessor.hpp @@ -6,6 +6,8 @@ #include <language/node_processor/INodeProcessor.hpp> #include <language/utils/BuiltinFunctionEmbedder.hpp> +#include <utils/SignalManager.hpp> + class BuiltinFunctionExpressionProcessor final : public INodeProcessor { private: @@ -59,11 +61,16 @@ class BuiltinFunctionProcessor : public INodeProcessor m_argument_converters[i]->convert(context_exec_policy, std::move(argument_values[i])); } } - try { + + if (SignalManager::pauseOnError()) { return m_function_expression_processor->execute(context_exec_policy); - } - catch (std::runtime_error& e) { - throw parse_error(e.what(), {m_argument_node.begin()}); + } else { + try { + return m_function_expression_processor->execute(context_exec_policy); + } + catch (std::runtime_error& e) { + throw parse_error(e.what(), {m_argument_node.begin()}); + } } } -- GitLab