Skip to content

Commit 857afa3

Browse files
authored
Merge pull request #463 from LambdaTest/stage
Release PR: Add try catch for cli debug logs
2 parents 33655b6 + 5256658 commit 857afa3

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lambdatest/smartui-cli",
3-
"version": "4.1.54-beta.0",
3+
"version": "4.1.54",
44
"description": "A command line interface (CLI) to run SmartUI tests on LambdaTest",
55
"files": [
66
"dist/**/*"

src/tasks/finalizeBuild.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,18 @@ export default (ctx: Context): ListrTask<Context, ListrRendererFactory, ListrRen
6363
let uploadCLILogsToS3 = ctx.config.useLambdaInternal || uploadDomToS3ViaEnv;
6464
if (!uploadCLILogsToS3) {
6565
ctx.log.debug(`Log file to be uploaded`)
66-
let resp = await ctx.client.getS3PreSignedURLForCaps(ctx, buildId, projectToken);
67-
await ctx.client.uploadLogsForCaps(ctx, resp.data.url);
66+
try {
67+
let resp = await ctx.client.getS3PreSignedURLForCaps(ctx, buildId, projectToken);
68+
await ctx.client.uploadLogsForCaps(ctx, resp.data.url);
69+
uploadedCliLogsBuildIds.add(buildId);
70+
} catch (error: any) {
71+
ctx.log.debug(`Error uploading CLI logs for build ${buildId}, session ${sessionId}: ${error.message}`);
72+
}
6873
} else {
6974
ctx.log.debug(`Log file to be uploaded via LSRS`)
7075
ctx.client.sendCliLogsToLSRSForCaps(ctx, buildId, projectToken);
76+
uploadedCliLogsBuildIds.add(buildId);
7177
}
72-
uploadedCliLogsBuildIds.add(buildId);
7378
}
7479
await ctx.client.finalizeBuildForCapsWithToken(buildId, totalSnapshots, projectToken, ctx.log);
7580
if (ctx.autoTunnelStarted) {

0 commit comments

Comments
 (0)