aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-11-13 18:04:06 -0700
committercrobibero <cody@robibe.ro>2020-11-13 18:04:06 -0700
commit73d2cb1c2a3a7cd1a30840a2b52921a3b81c6809 (patch)
tree922229602e0dbff30c371e70ed16512fb27eaa1e /Emby.Server.Implementations/AppBase/ConfigurationHelper.cs
parent24ac5cc353dd5b9930d43a5659d97037644fa58a (diff)
Updated based on review feedback
Diffstat (limited to 'Emby.Server.Implementations/AppBase/ConfigurationHelper.cs')
-rw-r--r--Emby.Server.Implementations/AppBase/ConfigurationHelper.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs
index 6c425c7fb..77819c764 100644
--- a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs
+++ b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs
@@ -36,7 +36,7 @@ namespace Emby.Server.Implementations.AppBase
}
catch (Exception)
{
- configuration = Activator.CreateInstance(type) ?? throw new ResourceNotFoundException(nameof(type));
+ configuration = Activator.CreateInstance(type) ?? throw new ArgumentException($"Provided path ({type}) is not valid.", nameof(type));
}
using var stream = new MemoryStream(buffer?.Length ?? 0);
@@ -49,7 +49,7 @@ namespace Emby.Server.Implementations.AppBase
// If the file didn't exist before, or if something has changed, re-save
if (buffer == null || !newBytes.AsSpan(0, newBytesLen).SequenceEqual(buffer))
{
- var directory = Path.GetDirectoryName(path) ?? throw new ResourceNotFoundException(nameof(path));
+ var directory = Path.GetDirectoryName(path) ?? throw new ArgumentException($"Provided path ({path}) is not valid.", nameof(path));
Directory.CreateDirectory(directory);
// Save it after load in case we got new items