Skip to content

Commit 1f8c6b9

Browse files
Pass to warning uncaught exceptions (actions#359)
1 parent 9a74eb4 commit 1f8c6b9

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

dist/cache-save/index.js

+7
Original file line numberDiff line numberDiff line change
@@ -46979,6 +46979,13 @@ const cache = __importStar(__webpack_require__(692));
4697946979
const fs_1 = __importDefault(__webpack_require__(747));
4698046980
const constants_1 = __webpack_require__(196);
4698146981
const cache_utils_1 = __webpack_require__(143);
46982+
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
46983+
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
46984+
// throw an uncaught exception. Instead of failing this action, just warn.
46985+
process.on('uncaughtException', e => {
46986+
const warningPrefix = '[warning]';
46987+
core.info(`${warningPrefix}${e.message}`);
46988+
});
4698246989
function run() {
4698346990
return __awaiter(this, void 0, void 0, function* () {
4698446991
try {

src/cache-save.ts

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ import fs from 'fs';
44
import {State} from './constants';
55
import {getCacheDirectoryPath, getPackageManagerInfo} from './cache-utils';
66

7+
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
8+
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
9+
// throw an uncaught exception. Instead of failing this action, just warn.
10+
process.on('uncaughtException', e => {
11+
const warningPrefix = '[warning]';
12+
core.info(`${warningPrefix}${e.message}`);
13+
});
14+
715
export async function run() {
816
try {
917
const cacheLock = core.getInput('cache');

0 commit comments

Comments
 (0)