Skip to content

Commit

Permalink
fix: print error when artifact upload fails
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-cg committed Nov 20, 2024
1 parent b92ce74 commit cb9fcb2
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 14 deletions.
9 changes: 7 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116412,8 +116412,13 @@ const uploadArtifact = (scanResult) => __awaiter(void 0, void 0, void 0, functio
const { id, size } = yield artifactClient.uploadArtifact(artifactName, files, rootDirectory, {});
core.info(`Scan result exported to artifact ${id}, size ${size}`);
}
catch (Error) {
core.error("Some items failed to export");
catch (e) {
if (e instanceof Error) {
core.error(`Some items failed to export: ${e.message}`);
}
else {
core.error(`Some items failed to export: ${e}`);
}
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116228,8 +116228,13 @@ const uploadArtifact = (scanResult) => __awaiter(void 0, void 0, void 0, functio
const { id, size } = yield artifactClient.uploadArtifact(artifactName, files, rootDirectory, {});
core.info(`Scan result exported to artifact ${id}, size ${size}`);
}
catch (Error) {
core.error("Some items failed to export");
catch (e) {
if (e instanceof Error) {
core.error(`Some items failed to export: ${e.message}`);
}
else {
core.error(`Some items failed to export: ${e}`);
}
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion dist/setup/index.js.map

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions dist/sign/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116225,8 +116225,13 @@ const uploadArtifact = (scanResult) => __awaiter(void 0, void 0, void 0, functio
const { id, size } = yield artifactClient.uploadArtifact(artifactName, files, rootDirectory, {});
core.info(`Scan result exported to artifact ${id}, size ${size}`);
}
catch (Error) {
core.error("Some items failed to export");
catch (e) {
if (e instanceof Error) {
core.error(`Some items failed to export: ${e.message}`);
}
else {
core.error(`Some items failed to export: ${e}`);
}
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion dist/sign/index.js.map

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions dist/verify/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116068,8 +116068,13 @@ const uploadArtifact = (scanResult) => __awaiter(void 0, void 0, void 0, functio
const { id, size } = yield artifactClient.uploadArtifact(artifactName, files, rootDirectory, {});
core.info(`Scan result exported to artifact ${id}, size ${size}`);
}
catch (Error) {
core.error("Some items failed to export");
catch (e) {
if (e instanceof Error) {
core.error(`Some items failed to export: ${e.message}`);
}
else {
core.error(`Some items failed to export: ${e}`);
}
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion dist/verify/index.js.map

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,12 @@ export const uploadArtifact = async (scanResult: string) => {
{}
);
core.info(`Scan result exported to artifact ${id}, size ${size}`);
} catch (Error) {
core.error("Some items failed to export");
} catch (e) {
if (e instanceof Error) {
core.error(`Some items failed to export: ${e.message}`);
} else {
core.error(`Some items failed to export: ${e}`);
}
}
}
};
Expand Down

0 comments on commit cb9fcb2

Please sign in to comment.