Merge pull request #3100 from sbwalker/dev
add error handling and logging to folder creation logic
This commit is contained in:
commit
4c940d02ef
|
@ -676,9 +676,16 @@ namespace Oqtane.Controllers
|
||||||
{
|
{
|
||||||
path = Utilities.PathCombine(path, folder, Path.DirectorySeparatorChar.ToString());
|
path = Utilities.PathCombine(path, folder, Path.DirectorySeparatorChar.ToString());
|
||||||
if (!Directory.Exists(path))
|
if (!Directory.Exists(path))
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(path);
|
Directory.CreateDirectory(path);
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.Log(LogLevel.Error, this, LogFunction.Create, ex, "Unable To Create Folder {Folder}", path);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user