Skip to content

Commit

Permalink
[DOP-4033]: Add error handling for dependency helper
Browse files Browse the repository at this point in the history
  • Loading branch information
branberry committed Oct 19, 2023
1 parent 0d63308 commit 234c843
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/commands/src/helpers/dependency-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,19 @@ export async function prepareBuildAndGetDependencies(repoName: string, projectNa
createEnvProdFile(repoDir, projectName, baseUrl),
];

const dependencies = await Promise.all(commandPromises);

return {
commitHash: dependencies[0] as string,
commitBranch: dependencies[1] as string,
patchId: dependencies[2] as string | undefined,
hasRedirects: dependencies[3] as boolean,
bundlePath: `${repoDir}/bundle.zip`,
repoDir,
};
try {
const dependencies = await Promise.all(commandPromises);

return {
commitHash: dependencies[0] as string,
commitBranch: dependencies[1] as string,
patchId: dependencies[2] as string | undefined,
hasRedirects: dependencies[3] as boolean,
bundlePath: `${repoDir}/bundle.zip`,
repoDir,
};
} catch (error) {
console.error('ERROR! Could not get build dependencies');
throw error;
}
}

0 comments on commit 234c843

Please sign in to comment.