Skip to content

Commit fed3366

Browse files
committed
Address comments
1 parent e67b241 commit fed3366

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

rosidl_gen/idl_generator.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,14 @@ function removeEmptyLines(str) {
4343
async function writeGeneratedCode(dir, fileName, code) {
4444
let result = null;
4545
if (!isDebug && fileName.endsWith('.js')) {
46-
result = await minify(code);
46+
try {
47+
result = await minify(code);
48+
} catch (error) {
49+
console.error(`Error minifying ${fileName}:`, error);
50+
result = null;
51+
}
4752
}
53+
4854
await fse.mkdirs(dir);
4955
await fse.writeFile(path.join(dir, fileName), result ? result.code : code);
5056
}

0 commit comments

Comments
 (0)