TW-1667: hooks: upon failure indicate which hook failed

- Thanks to Daniel Shahaf.
This commit is contained in:
Paul Beckingham 2017-01-16 13:14:08 -05:00
parent 098eef099a
commit 44dc19e21b
14 changed files with 106 additions and 93 deletions

View file

@ -8,6 +8,8 @@
(thanks to Eric Fluger).
- TW-1572 Alternative approach to urgency inheritance
(thanks to Jens Erat, Wim Schuermann).
- TW-1667 hooks: upon failure indicate which hook failed
(thanks to Daniel Shahaf).
- TW-1785 Purge command to remove deleted tasks
(thanks to Paul Beckingham).
- TW-1772 Implementation of circular dependency detection is

View file

@ -42,6 +42,7 @@
#include <Lexer.h>
#include <JSON.h>
#include <Timer.h>
#include <FS.h>
#include <format.h>
#include <shared.h>
#include <util.h>
@ -138,7 +139,7 @@ void Hooks::onLaunch () const
std::vector <std::string> outputFeedback;
separateOutput (output, outputJSON, outputFeedback);
assertNTasks (outputJSON, 0);
assertNTasks (outputJSON, 0, script);
if (status == 0)
{
@ -147,7 +148,7 @@ void Hooks::onLaunch () const
}
else
{
assertFeedback (outputFeedback);
assertFeedback (outputFeedback, script);
for (auto& message : outputFeedback)
context.error (message);
@ -200,7 +201,7 @@ void Hooks::onExit () const
std::vector <std::string> outputFeedback;
separateOutput (output, outputJSON, outputFeedback);
assertNTasks (outputJSON, 0);
assertNTasks (outputJSON, 0, script);
if (status == 0)
{
@ -209,7 +210,7 @@ void Hooks::onExit () const
}
else
{
assertFeedback (outputFeedback);
assertFeedback (outputFeedback, script);
for (auto& message : outputFeedback)
context.error (message);
@ -259,9 +260,9 @@ void Hooks::onAdd (Task& task) const
if (status == 0)
{
assertNTasks (outputJSON, 1);
assertValidJSON (outputJSON);
assertSameTask (outputJSON, task);
assertNTasks (outputJSON, 1, script);
assertValidJSON (outputJSON, script);
assertSameTask (outputJSON, task, script);
// Propagate forward to the next script.
input[0] = outputJSON[0];
@ -271,7 +272,7 @@ void Hooks::onAdd (Task& task) const
}
else
{
assertFeedback (outputFeedback);
assertFeedback (outputFeedback, script);
for (auto& message : outputFeedback)
context.error (message);
@ -326,9 +327,9 @@ void Hooks::onModify (const Task& before, Task& after) const
if (status == 0)
{
assertNTasks (outputJSON, 1);
assertValidJSON (outputJSON);
assertSameTask (outputJSON, before);
assertNTasks (outputJSON, 1, script);
assertValidJSON (outputJSON, script);
assertSameTask (outputJSON, before, script);
// Propagate accepted changes forward to the next script.
input[1] = outputJSON[0];
@ -338,7 +339,7 @@ void Hooks::onModify (const Task& before, Task& after) const
}
else
{
assertFeedback (outputFeedback);
assertFeedback (outputFeedback, script);
for (auto& message : outputFeedback)
context.error (message);
@ -399,7 +400,9 @@ bool Hooks::isJSON (const std::string& input) const
}
////////////////////////////////////////////////////////////////////////////////
void Hooks::assertValidJSON (const std::vector <std::string>& input) const
void Hooks::assertValidJSON (
const std::vector <std::string>& input,
const std::string& script) const
{
for (auto& i : input)
{
@ -407,7 +410,7 @@ void Hooks::assertValidJSON (const std::vector <std::string>& input) const
i[0] != '{' ||
i[i.length () - 1] != '}')
{
context.error (STRING_HOOK_ERROR_OBJECT);
context.error (format (STRING_HOOK_ERROR_OBJECT, Path (script).name ()));
throw 0;
}
@ -416,19 +419,19 @@ void Hooks::assertValidJSON (const std::vector <std::string>& input) const
json::value* root = json::parse (i);
if (root->type () != json::j_object)
{
context.error (STRING_HOOK_ERROR_OBJECT);
context.error (format (STRING_HOOK_ERROR_OBJECT, Path (script).name ()));
throw 0;
}
if (((json::object*)root)->_data.find ("description") == ((json::object*)root)->_data.end ())
{
context.error (STRING_HOOK_ERROR_NODESC);
context.error (format (STRING_HOOK_ERROR_NODESC, Path (script).name ()));
throw 0;
}
if (((json::object*)root)->_data.find ("uuid") == ((json::object*)root)->_data.end ())
{
context.error (STRING_HOOK_ERROR_NOUUID);
context.error (format (STRING_HOOK_ERROR_NOUUID, Path (script).name ()));
throw 0;
}
@ -452,17 +455,23 @@ void Hooks::assertValidJSON (const std::vector <std::string>& input) const
}
////////////////////////////////////////////////////////////////////////////////
void Hooks::assertNTasks (const std::vector <std::string>& input, unsigned int n) const
void Hooks::assertNTasks (
const std::vector <std::string>& input,
unsigned int n,
const std::string& script) const
{
if (input.size () != n)
{
context.error (format (STRING_HOOK_ERROR_BAD_NUM, n, (int) input.size ()));
context.error (format (STRING_HOOK_ERROR_BAD_NUM, n, (int) input.size (), Path (script).name ()));
throw 0;
}
}
////////////////////////////////////////////////////////////////////////////////
void Hooks::assertSameTask (const std::vector <std::string>& input, const Task& task) const
void Hooks::assertSameTask (
const std::vector <std::string>& input,
const Task& task,
const std::string& script) const
{
std::string uuid = task.get ("uuid");
@ -475,7 +484,7 @@ void Hooks::assertSameTask (const std::vector <std::string>& input, const Task&
if (u == root_obj->_data.end () ||
u->second->type () != json::j_string)
{
context.error (format (STRING_HOOK_ERROR_SAME1, uuid));
context.error (format (STRING_HOOK_ERROR_SAME1, uuid, Path (script).name ()));
throw 0;
}
@ -485,7 +494,7 @@ void Hooks::assertSameTask (const std::vector <std::string>& input, const Task&
std::string json_uuid = json::decode (text);
if (json_uuid != uuid)
{
context.error (format (STRING_HOOK_ERROR_SAME2, uuid, json_uuid));
context.error (format (STRING_HOOK_ERROR_SAME2, uuid, json_uuid, Path (script).name ()));
throw 0;
}
@ -494,7 +503,9 @@ void Hooks::assertSameTask (const std::vector <std::string>& input, const Task&
}
////////////////////////////////////////////////////////////////////////////////
void Hooks::assertFeedback (const std::vector <std::string>& input) const
void Hooks::assertFeedback (
const std::vector <std::string>& input,
const std::string& script) const
{
bool foundSomething = false;
for (auto& i : input)
@ -503,7 +514,7 @@ void Hooks::assertFeedback (const std::vector <std::string>& input) const
if (! foundSomething)
{
context.error (STRING_HOOK_ERROR_NOFEEDBACK);
context.error (format (STRING_HOOK_ERROR_NOFEEDBACK, Path (script).name ()));
throw 0;
}
}

View file

@ -47,10 +47,10 @@ private:
std::vector <std::string> scripts (const std::string&) const;
void separateOutput (const std::vector <std::string>&, std::vector <std::string>&, std::vector <std::string>&) const;
bool isJSON (const std::string&) const;
void assertValidJSON (const std::vector <std::string>&) const;
void assertNTasks (const std::vector <std::string>&, unsigned int) const;
void assertSameTask (const std::vector <std::string>&, const Task&) const;
void assertFeedback (const std::vector <std::string>&) const;
void assertValidJSON (const std::vector <std::string>&, const std::string&) const;
void assertNTasks (const std::vector <std::string>&, unsigned int, const std::string&) const;
void assertSameTask (const std::vector <std::string>&, const Task&, const std::string&) const;
void assertFeedback (const std::vector <std::string>&, const std::string&) const;
std::vector <std::string>& buildHookScriptArgs (std::vector <std::string>&) const;
int callHookScript (const std::string&, const std::vector <std::string>&, std::vector <std::string>&) const;

View file

@ -801,16 +801,16 @@
#define STRING_HELPER_PROJECT_REM1 "({1} task remaining)."
// Hooks
#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected."
#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute."
#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute."
#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected from hook script: {1}"
#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute from hook script: {1}"
#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute from hook script: {1}"
#define STRING_HOOK_ERROR_SYNTAX "Hook Error: JSON syntax error in: {1}"
#define STRING_HOOK_ERROR_JSON "Hook Error: JSON "
#define STRING_HOOK_ERROR_NOPARSE "Hook Error: JSON failed to parse: "
#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}"
#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}"
#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}"
#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from a failing hook script."
#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}, in hook script: {3}"
#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}, in hook script: {2}"
#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}, in hook script: {3}"
#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from failing hook script: {1}"
// Record
#define STRING_RECORD_EMPTY "Leerer Datensatz in der Eingabe."

View file

@ -799,16 +799,16 @@
#define STRING_HELPER_PROJECT_REM1 "({1} task remaining)."
// Hooks
#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected."
#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute."
#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute."
#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected from hook script: {1}"
#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute from hook script: {1}"
#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute from hook script: {1}"
#define STRING_HOOK_ERROR_SYNTAX "Hook Error: JSON syntax error in: {1}"
#define STRING_HOOK_ERROR_JSON "Hook Error: JSON "
#define STRING_HOOK_ERROR_NOPARSE "Hook Error: JSON failed to parse: "
#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}"
#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}"
#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}"
#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from a failing hook script."
#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}, in hook script: {3}"
#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}, in hook script: {2}"
#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}, in hook script: {3}"
#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from failing hook script: {1}"
// Record
#define STRING_RECORD_EMPTY "Empty record in input."

View file

@ -801,16 +801,16 @@
#define STRING_HELPER_PROJECT_REM1 "({1} task remaining)."
// Hooks
#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected."
#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute."
#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute."
#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected from hook script: {1}"
#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute from hook script: {1}"
#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute from hook script: {1}"
#define STRING_HOOK_ERROR_SYNTAX "Hook Error: JSON syntax error in: {1}"
#define STRING_HOOK_ERROR_JSON "Hook Error: JSON "
#define STRING_HOOK_ERROR_NOPARSE "Hook Error: JSON failed to parse: "
#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}"
#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}"
#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}"
#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from a failing hook script."
#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}, in hook script: {3}"
#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}, in hook script: {2}"
#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}, in hook script: {3}"
#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from failing hook script: {1}"
// Record
#define STRING_RECORD_EMPTY "Malplena rikordo en la inigo."

View file

@ -810,16 +810,16 @@
#define STRING_HELPER_PROJECT_REM1 "({1} tarea restante)."
// Hooks
#define STRING_HOOK_ERROR_OBJECT "Hook Error: se esperaba 0bjeto JSON '{...}'."
#define STRING_HOOK_ERROR_NODESC "Hook Error: falta atributo 'description' en objeto JSON."
#define STRING_HOOK_ERROR_NOUUID "Hook Error: falta atributo 'uuid' en objeto JSON."
#define STRING_HOOK_ERROR_OBJECT "Hook Error: se esperaba 0bjeto JSON '{...}' hook script: {1}"
#define STRING_HOOK_ERROR_NODESC "Hook Error: falta atributo 'description' en objeto JSON hook script: {1}."
#define STRING_HOOK_ERROR_NOUUID "Hook Error: falta atributo 'uuid' en objeto JSON hook script: {1}."
#define STRING_HOOK_ERROR_SYNTAX "Hook Error: error de sintaxis JSON en: {1}"
#define STRING_HOOK_ERROR_JSON "Hook Error: JSON " // |esp-ESP|==|eng-USA|
#define STRING_HOOK_ERROR_NOPARSE "Hook Error: fallo al interpretar JSON: "
#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: se esperaba {1} tarea(s) JSON, se encontraron {2}"
#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON debe ser para la misma tarea: {1}"
#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON debe ser para la misma tarea: {1} != {2}"
#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: se esperaba retro-alimentación desde un hook script que falló."
#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: se esperaba {1} tarea(s) JSON, se encontraron {2}, hook script: {3}"
#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON debe ser para la misma tarea: {1}, hook script: {2}"
#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON debe ser para la misma tarea: {1} != {2}, hook script: {3}"
#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: se esperaba retro-alimentación desde un hook script que falló: {1}"
// Record
#define STRING_RECORD_EMPTY "Registro vacío en la entrada."

View file

@ -801,16 +801,16 @@
#define STRING_HELPER_PROJECT_REM1 "({1} task remaining)."
// Hooks
#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected."
#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute."
#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute."
#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected from hook script: {1}"
#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute from hook script: {1}"
#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute from hook script: {1}"
#define STRING_HOOK_ERROR_SYNTAX "Hook Error: JSON syntax error in: {1}"
#define STRING_HOOK_ERROR_JSON "Hook Error: JSON "
#define STRING_HOOK_ERROR_NOPARSE "Hook Error: JSON failed to parse: "
#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}"
#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}"
#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}"
#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from a failing hook script."
#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}, in hook script: {3}"
#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}, in hook script: {2}"
#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}, in hook script: {3}"
#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from failing hook script: {1}"
// Record
#define STRING_RECORD_EMPTY "Empty record in input."

View file

@ -800,16 +800,16 @@
#define STRING_HELPER_PROJECT_REM1 "({1} task remaining)."
// Hooks
#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected."
#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute."
#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute."
#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected from hook script: {1}"
#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute from hook script: {1}"
#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute from hook script: {1}"
#define STRING_HOOK_ERROR_SYNTAX "Hook Error: JSON syntax error in: {1}"
#define STRING_HOOK_ERROR_JSON "Hook Error: JSON "
#define STRING_HOOK_ERROR_NOPARSE "Hook Error: JSON failed to parse: "
#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}"
#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}"
#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}"
#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from a failing hook script."
#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}, in hook script: {3}"
#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}, in hook script: {2}"
#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}, in hook script: {3}"
#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from failing hook script: {1}"
// Record
#define STRING_RECORD_EMPTY "Voce vuota in ingresso."

View file

@ -801,16 +801,16 @@
#define STRING_HELPER_PROJECT_REM1 "({1} task remaining)."
// Hooks
#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected."
#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute."
#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute."
#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected from hook script: {1}"
#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute from hook script: {1}"
#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute from hook script: {1}"
#define STRING_HOOK_ERROR_SYNTAX "Hook Error: JSON syntax error in: {1}"
#define STRING_HOOK_ERROR_JSON "Hook Error: JSON "
#define STRING_HOOK_ERROR_NOPARSE "Hook Error: JSON failed to parse: "
#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}"
#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}"
#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}"
#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from a failing hook script."
#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}, in hook script: {3}"
#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}, in hook script: {2}"
#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}, in hook script: {3}"
#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from failing hook script: {1}"
// Record
#define STRING_RECORD_EMPTY "Empty record in input."

View file

@ -801,16 +801,16 @@
#define STRING_HELPER_PROJECT_REM1 "({1} task remaining)."
// Hooks
#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected."
#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute."
#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute."
#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected from hook script: {1}"
#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute from hook script: {1}"
#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute from hook script: {1}"
#define STRING_HOOK_ERROR_SYNTAX "Hook Error: JSON syntax error in: {1}"
#define STRING_HOOK_ERROR_JSON "Hook Error: JSON "
#define STRING_HOOK_ERROR_NOPARSE "Hook Error: JSON failed to parse: "
#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}"
#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}"
#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}"
#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from a failing hook script."
#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}, in hook script: {3}"
#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}, in hook script: {2}"
#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}, in hook script: {3}"
#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from failing hook script: {1}"
// Record
#define STRING_RECORD_EMPTY "Pusty wpis na wejściu."

View file

@ -801,16 +801,16 @@
#define STRING_HELPER_PROJECT_REM1 "({1} task remaining)."
// Hooks
#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected."
#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute."
#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute."
#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected from hook script: {1}"
#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute from hook script: {1}"
#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute from hook script: {1}"
#define STRING_HOOK_ERROR_SYNTAX "Hook Error: JSON syntax error in: {1}"
#define STRING_HOOK_ERROR_JSON "Hook Error: JSON "
#define STRING_HOOK_ERROR_NOPARSE "Hook Error: JSON failed to parse: "
#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}"
#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}"
#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}"
#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from a failing hook script."
#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}, in hook script: {3}"
#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}, in hook script: {2}"
#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}, in hook script: {3}"
#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from failing hook script: {1}"
// Record
#define STRING_RECORD_EMPTY "Registo vazio na entrada fornecida."

View file

@ -147,7 +147,7 @@ class TestHooksOnAdd(TestCase):
self.t.hooks.add_default(hookname, log=True)
code, out, err = self.t.runError("add foo")
self.assertIn("Hook Error: JSON Object missing 'uuid' attribute.", err)
self.assertIn("Hook Error: JSON Object missing 'uuid' attribute from hook script: on-add-misbehave6", err)
hook = self.t.hooks[hookname]
hook.assertTriggeredCount(1)

View file

@ -146,7 +146,7 @@ class TestHooksOnModify(TestCase):
code, out, err = self.t("add foo")
code, out, err = self.t.runError("1 modify +tag")
self.assertIn("Hook Error: JSON Object missing 'uuid' attribute.", err)
self.assertIn("Hook Error: JSON Object missing 'uuid' attribute from hook script: on-modify-misbehave6", err)
hook = self.t.hooks[hookname]
hook.assertTriggeredCount(1)