- Deferred JSON checking until after we know whether the hooks voluntarily
  failed the event.
This commit is contained in:
Paul Beckingham 2015-02-14 17:33:48 -05:00
parent e00704a375
commit a2e980c6b8

View file

@ -258,12 +258,12 @@ void Hooks::onAdd (Task& task)
std::vector <std::string> outputFeedback; std::vector <std::string> outputFeedback;
separateOutput (output, outputJSON, outputFeedback); separateOutput (output, outputJSON, outputFeedback);
assertNTasks (outputJSON, 1);
assertValidJSON (outputJSON);
assertSameTask (outputJSON, task);
if (status == 0) if (status == 0)
{ {
assertNTasks (outputJSON, 1);
assertValidJSON (outputJSON);
assertSameTask (outputJSON, task);
// Propagate forward to the next script. // Propagate forward to the next script.
input[0] = outputJSON[0]; input[0] = outputJSON[0];
@ -327,12 +327,12 @@ void Hooks::onModify (const Task& before, Task& after)
std::vector <std::string> outputFeedback; std::vector <std::string> outputFeedback;
separateOutput (output, outputJSON, outputFeedback); separateOutput (output, outputJSON, outputFeedback);
assertNTasks (outputJSON, 1);
assertValidJSON (outputJSON);
assertSameTask (outputJSON, before);
if (status == 0) if (status == 0)
{ {
assertNTasks (outputJSON, 1);
assertValidJSON (outputJSON);
assertSameTask (outputJSON, before);
// Propagate accepted changes forward to the next script. // Propagate accepted changes forward to the next script.
input[1] = outputJSON[0]; input[1] = outputJSON[0];