fix(tools): upgrade warning to throw (#40880)

This commit is contained in:
Oliver Eyton-Williams
2021-02-03 10:43:32 +01:00
committed by GitHub
parent 1a642ba542
commit 7ef29e62a8
2 changed files with 42 additions and 24 deletions

View File

@@ -137,8 +137,8 @@ function translateGeneric(text, config, regexBefore, regexAfter) {
for (const [match, before, comment, after] of matches) {
if (knownComments.includes(comment)) {
text = text.replace(match, `${before}${dict[comment][lang]}${after}`);
} else {
console.warn(`${comment} does not appear in the comment dictionary`);
} else if (comment.trim()) {
throw `${comment} does not appear in the comment dictionary`;
}
}