From f20a184a017ffbe5a2123596aab54ff6af719232 Mon Sep 17 00:00:00 2001 From: Jack Franklin Date: Thu, 13 Aug 2020 14:11:54 +0100 Subject: [PATCH] Log errors when regenerating all component bridges Without this change if you run regenerate-all-component-bridges and one of the files causes an error, that will stop execution immediately. This CL means the rest of the component bridges will still be regenerated, and we'll log out the error for the component that caused the problem. Change-Id: I26627f0836f7684bb28d45ea50ff19ef692e98dd Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2354097 Commit-Queue: Jack Franklin Commit-Queue: Alex Rudenko Auto-Submit: Jack Franklin Reviewed-by: Alex Rudenko --- scripts/component_bridges/regenerate-all-bridges.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/component_bridges/regenerate-all-bridges.ts b/scripts/component_bridges/regenerate-all-bridges.ts index b2386c59a1..575f3d8307 100644 --- a/scripts/component_bridges/regenerate-all-bridges.ts +++ b/scripts/component_bridges/regenerate-all-bridges.ts @@ -14,7 +14,11 @@ const regenerateBridge = (pathToBridge: string) => { throw new Error(`Could not find source file ${sourceFile}`); } - main([sourceFile, ...process.argv.slice(2)]); + try { + main([sourceFile, ...process.argv.slice(2)]); + } catch (e) { + console.error(`ERROR regenerating bridge: ${e.message}`); + } }; const excludedDirectories = new Set([path.resolve(path.join(process.cwd(), 'front_end', 'third_party'))]);