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.
This commit is contained in:
Tomas Babej 2021-08-31 18:19:26 -04:00
parent 9ce366ddab
commit 99f4929dc5
No known key found for this signature in database
GPG key ID: B0747C6578F7D2F5

View file

@ -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]);
}
}