Skip to content

Commit a0f9469

Browse files
committed
Add specific error handling
1 parent 8c6f3cc commit a0f9469

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

devtools/dashboard_utilities.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,12 @@ export function createMocksList(files) {
5555
file: filename,
5656
keywords: types.join(', ')
5757
};
58-
} catch {
59-
console.log(`Couldn't parse ${file.name} as JSON. Excluding from mocks list.`);
58+
} catch (error) {
59+
if (error instanceof SyntaxError) {
60+
console.log(`Couldn't parse ${file.name} as JSON. Excluding from mocks list.`);
61+
} else {
62+
throw error;
63+
}
6064
}
6165
});
6266

0 commit comments

Comments
 (0)