From 1d3f30e442ddd744c89172f137b06542fa497c7d Mon Sep 17 00:00:00 2001 From: amit3200 Date: Mon, 9 Dec 2024 15:24:38 +0530 Subject: [PATCH] Adding Error Capturing on Finalize Builds --- packages/cli-build/src/finalize.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/cli-build/src/finalize.js b/packages/cli-build/src/finalize.js index 5c3f579bf..ef311314c 100644 --- a/packages/cli-build/src/finalize.js +++ b/packages/cli-build/src/finalize.js @@ -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}`); });