CmdReport: Throw error if report fails to produce output

Ideally this would be fixed in libshared.

See GothenburgBitFactory/libshared#27

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
This commit is contained in:
Shaun Ruffell 2020-08-14 06:32:19 -05:00 committed by lauft
parent 670fc289e9
commit 26fdebf754

View file

@ -109,7 +109,11 @@ int CmdReport (
// Run the extensions.
std::vector <std::string> output;
extensions.callExtension (script, split (input, '\n'), output);
int rc = extensions.callExtension (script, split (input, '\n'), output);
if (rc != 0 && output.size () == 0)
{
throw format ("'{1}' returned {2} without producing output.", script, rc);
}
// Display the output.
for (auto& line : output)