3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Add debug logging for unsafe template formatter values

This commit is contained in:
Dragory 2021-08-20 22:21:13 +03:00
parent d0139f6c2e
commit dcdaaf9de8
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -65,6 +65,13 @@ export class TemplateSafeValueContainer {
constructor(data: Record<string, TemplateSafeValue> = {}) {
for (const [key, value] of Object.entries(data)) {
if (!isTemplateSafeValue(value)) {
// tslint:disable:no-console
console.error("=== CONTEXT FOR UNSAFE VALUE ===");
console.error("stringified:", JSON.stringify(value));
console.error("typeof:", typeof value);
console.error("constructor name:", (value as any)?.constructor?.name);
console.error("=== /CONTEXT FOR UNSAFE VALUE ===");
// tslint:enable:no-console
throw new Error(`Unsafe value for key "${key}" in SafeTemplateValueContainer`);
}