From 448390127081ae7e0a33512651a524748970c37e Mon Sep 17 00:00:00 2001 From: sbwalker Date: Thu, 3 Aug 2023 14:45:27 -0400 Subject: [PATCH] fix #3072 - add error handling and logging to folder creation logic --- Oqtane.Server/Controllers/FileController.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Oqtane.Server/Controllers/FileController.cs b/Oqtane.Server/Controllers/FileController.cs index 31ed3c80..a100dd22 100644 --- a/Oqtane.Server/Controllers/FileController.cs +++ b/Oqtane.Server/Controllers/FileController.cs @@ -677,7 +677,14 @@ namespace Oqtane.Controllers path = Utilities.PathCombine(path, folder, Path.DirectorySeparatorChar.ToString()); if (!Directory.Exists(path)) { - Directory.CreateDirectory(path); + try + { + Directory.CreateDirectory(path); + } + catch (Exception ex) + { + _logger.Log(LogLevel.Error, this, LogFunction.Create, ex, "Unable To Create Folder {Folder}", path); + } } } }