3
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2025-04-22 11:25:31 +00:00

Catch and log unhandled exceptions stemming from closed file descriptor (#596)

This commit is contained in:
David Hadka 2021-05-27 10:46:35 -05:00 committed by GitHub
parent cc2d767a72
commit c64c572235
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 404 additions and 395 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()) {