mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
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:
parent
670fc289e9
commit
26fdebf754
1 changed files with 5 additions and 1 deletions
|
@ -109,7 +109,11 @@ int CmdReport (
|
||||||
|
|
||||||
// Run the extensions.
|
// Run the extensions.
|
||||||
std::vector <std::string> output;
|
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.
|
// Display the output.
|
||||||
for (auto& line : output)
|
for (auto& line : output)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue