From ead20f7924ca0fc6f64fe8bad4141d8ba31cf97e Mon Sep 17 00:00:00 2001 From: netkas Date: Tue, 11 Mar 2025 13:56:37 -0400 Subject: [PATCH] Improve error handling in ShutdownHandler by logging warnings for cleanup failures --- CHANGELOG.md | 1 + src/ncc/Classes/ShutdownHandler.php | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b60100e..1f9ea4b 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ This update introduces a quality of life improvement ### Changed - Refactor variable names for consistency and clarity in ShutdownHandler and PackageWriter classes + - Improve error handling in ShutdownHandler by logging warnings for cleanup failures ## [2.1.6] - 2024-10-29 diff --git a/src/ncc/Classes/ShutdownHandler.php b/src/ncc/Classes/ShutdownHandler.php index 19bae03..3ce262d 100755 --- a/src/ncc/Classes/ShutdownHandler.php +++ b/src/ncc/Classes/ShutdownHandler.php @@ -68,16 +68,15 @@ if(count(self::$cleanupPaths) > 0) { $filesystem = new Filesystem(); - foreach(self::$cleanupPaths as $path) { try { - //$filesystem->remove($path); + $filesystem->remove($path); } catch(Exception $e) { - // ignore + Console::outWarning('An error occurred while cleaning up temporary path "' . $path . '", ' . $e->getMessage()); } } }