error: improved validation error message
@@ -146,7 +146,8 @@ static int validateKey (Key * key, Key * parentKey)
const Key * msg = keyGetMeta (key, "check/validation/message");
if (msg)
{
- ELEKTRA_SET_VALIDATION_SYNTACTIC_ERRORF (parentKey, "Key value failed to validate. Reason: %s", keyString (msg));
+ ELEKTRA_SET_VALIDATION_SYNTACTIC_ERRORF (parentKey, "The key '%s' does not confirm to '%s'. Reason: %s",
+ keyName (key), regexString, keyString (msg));
regfree (&regex);
if (freeString) elektraFree (regexString);
return 0;
@@ -155,7 +156,8 @@ static int validateKey (Key * key, Key * parentKey)
{
char buffer[1000];
regerror (ret, &regex, buffer, 999);
- ELEKTRA_SET_VALIDATION_SYNTACTIC_ERRORF (parentKey, "Key value failed to validate. Reason: %s", buffer);
+ ELEKTRA_SET_VALIDATION_SYNTACTIC_ERRORF (parentKey, "The key '%s' does not confirm to '%s'. Reason: %s",
+ keyName (key), regexString, buffer);
regfree (&regex);
if (freeString) elektraFree (regexString);
return 0;
