From 99f4929dc5f481114a86519d0b42ec779f06741b Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Tue, 31 Aug 2021 18:19:26 -0400 Subject: [PATCH] CmdExport: Throw an exception when the report is not found The Context::getContext ().error only issues a log message, but allows the execution of the program. In order to interrupt the execution, an exception must be raised. --- src/commands/CmdExport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/CmdExport.cpp b/src/commands/CmdExport.cpp index 4ec50dbee..4242969b4 100644 --- a/src/commands/CmdExport.cpp +++ b/src/commands/CmdExport.cpp @@ -71,7 +71,7 @@ int CmdExport::execute (std::string& output) } if (selectedReport.empty ()) { - Context::getContext ().error("Unable to find report that matches '" + words[0] + "'."); + throw format("Unable to find report that matches '{1}'.", words[0]); } }