Fixed sync-i18n script not working anymore

This is caused by the typescript 4.4 update that changed the catch type from any to unknown
This commit is contained in:
Alexandre Vryghem
2024-04-14 21:28:26 +02:00
parent c13d23da9c
commit 0ba1b26318

View File

@@ -275,9 +275,11 @@ function readFileIfExists(pathToFile) {
try { try {
return fs.readFileSync(pathToFile, 'utf8'); return fs.readFileSync(pathToFile, 'utf8');
} catch (e) { } catch (e) {
if (e instanceof Error) {
console.error('Error:', e.stack); console.error('Error:', e.stack);
} }
} }
}
return null; return null;
} }