refactor(api): consistent VALIDATE messages #22262

Problem:
Validation messages are not consistently formatted.
- Parameter names sometimes are NOT quoted.
- Descriptive names (non-parameters) sometimes ARE quoted.

Solution:
Always quote the `name` value passed to a VALIDATE macro _unless_ the
value has whitespace.
This commit is contained in:
Justin M. Keyes
2023-02-14 14:19:28 -05:00
committed by GitHub
parent e03ecb7d31
commit 556f8646c0
18 changed files with 215 additions and 139 deletions

View File

@@ -1089,7 +1089,7 @@ int object_to_color(Object val, char *key, bool rgb, Error *err)
});
return color;
} else {
VALIDATE(false, "Invalid %s: expected String or Integer", key, {
VALIDATE_EXP(false, key, "String or Integer", NULL, {
return 0;
});
}