Skip to content

Commit

Permalink
Adding Error Capturing on Finalize Builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Amit3200 committed Dec 9, 2024
1 parent c53d22e commit 1d3f30e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/cli-build/src/finalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ export const finalize = command('finalize', {

// rely on the parallel nonce to cause the API to return the current running build for the nonce
let { data: build } = await percy.client.createBuild({ cliStartTime: percy.cliStartTime });
await percy.client.finalizeBuild(build.id, { all: true });

try {
await percy.client.finalizeBuild(build.id, { all: true });
} catch (error) {
exit(1, 'Percy build failed during finalize', error.message);
}
let { 'build-number': number, 'web-url': url } = build.attributes;
log.info(`Finalized build #${number}: ${url}`);
});
Expand Down

0 comments on commit 1d3f30e

Please sign in to comment.