Handle uncaught exceptions caused by closing file descriptor

This commit is contained in:
Dave Hadka 2021-05-26 19:44:37 -05:00
parent cc2d767a72
commit 67324ade11
3 changed files with 402 additions and 393 deletions

View file

@ -4,6 +4,11 @@ import * as core from "@actions/core";
import { Events, Inputs, State } from "./constants";
import * as utils from "./utils/actionUtils";
// 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 => utils.logWarning(e.message));
async function run(): Promise<void> {
try {
if (utils.isGhes()) {