1
0
Fork 0
mirror of https://github.com/actions/setup-node synced 2024-11-14 01:22:40 +00:00

Pass to warning uncaught exceptions (#359)

This commit is contained in:
Dmitry Shibanov 2021-12-28 12:25:43 +03:00 committed by GitHub
parent 9a74eb4e64
commit 1f8c6b94b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View file

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

View file

@ -4,6 +4,14 @@ import fs from 'fs';
import {State} from './constants'; import {State} from './constants';
import {getCacheDirectoryPath, getPackageManagerInfo} from './cache-utils'; import {getCacheDirectoryPath, getPackageManagerInfo} from './cache-utils';
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
// throw an uncaught exception. Instead of failing this action, just warn.
process.on('uncaughtException', e => {
const warningPrefix = '[warning]';
core.info(`${warningPrefix}${e.message}`);
});
export async function run() { export async function run() {
try { try {
const cacheLock = core.getInput('cache'); const cacheLock = core.getInput('cache');