From 9bd4e8c5c0fb7167874cb2078d55430db53fe00c Mon Sep 17 00:00:00 2001 From: Don Richards <2738244+DonRichards@users.noreply.github.com> Date: Mon, 20 Feb 2023 14:24:40 -0500 Subject: [PATCH] Update MediaSourceService.php --- src/MediaSource/MediaSourceService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MediaSource/MediaSourceService.php b/src/MediaSource/MediaSourceService.php index b554cf68..befab65a 100644 --- a/src/MediaSource/MediaSourceService.php +++ b/src/MediaSource/MediaSourceService.php @@ -294,7 +294,9 @@ class MediaSourceService { $parent_directory = dirname($directory); $error_current_user = shell_exec('whoami'); $sanitized_current_user = str_replace(array("\n", "\r"), '', $error_current_user); - throw new HttpException(500, "The destination directory does not exist, could not be created, or is not writable by $sanitized_current_user: $directory"); + $error_message = "The destination directory does not exist, could not be created, or is not writable by $sanitized_current_user: $directory"; + watchdog('media_source_service', $error_message, [], WATCHDOG_ERROR); + throw new HttpException(500, "An error occurred while processing your request. Please contact the website administrator."); } // Copy over the file content.