Skip to content

Commit

Permalink
Pass to warning uncaught exceptions (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-shibanov authored Dec 28, 2021
1 parent 9a74eb4 commit 1f8c6b9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dist/cache-save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46979,6 +46979,13 @@ const cache = __importStar(__webpack_require__(692));
const fs_1 = __importDefault(__webpack_require__(747));
const constants_1 = __webpack_require__(196);
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() {
return __awaiter(this, void 0, void 0, function* () {
try {
Expand Down
8 changes: 8 additions & 0 deletions src/cache-save.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ import fs from 'fs';
import {State} from './constants';
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() {
try {
const cacheLock = core.getInput('cache');
Expand Down

0 comments on commit 1f8c6b9

Please sign in to comment.