aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Common/Validation/FileExistsAttribute.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-11-07 23:16:26 -0600
committerGitHub <noreply@github.com>2026-11-07 23:16:26 -0600
commitcefdcd02e28b1f02f546002fdd475de4fa03e839 (patch)
tree95bb26f4ed7b60e3739bcd884966a19be1e9ee07 /src/slskd/Common/Validation/FileExistsAttribute.cs
parent2b827344d11e7490b323defa898264cadbdb6089 (diff)
parentdbc308d5e408a2e194a0c70a8fc7592f776aaf11 (diff)
downloadslskd-cefdcd02e28b1f02f546002fdd475de4fa03e839.tar.gz
Merge pull request #1913 from slskd/bugs
Fix a random assortment of bugs
Diffstat (limited to 'src/slskd/Common/Validation/FileExistsAttribute.cs')
-rw-r--r--src/slskd/Common/Validation/FileExistsAttribute.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/slskd/Common/Validation/FileExistsAttribute.cs b/src/slskd/Common/Validation/FileExistsAttribute.cs
index c4d97a7c..6fc50f63 100644
--- a/src/slskd/Common/Validation/FileExistsAttribute.cs
+++ b/src/slskd/Common/Validation/FileExistsAttribute.cs
@@ -32,6 +32,7 @@
namespace slskd.Validation
{
+ using System;
using System.ComponentModel.DataAnnotations;
using System.IO;
@@ -71,7 +72,7 @@ namespace slskd.Validation
using var fs = File.Open(file, FileMode.Open, FileAccess.Value);
fs.Close();
}
- catch (IOException)
+ catch (Exception ex) when (ex is IOException || ex is UnauthorizedAccessException)
{
return new ValidationResult($"The {validationContext.DisplayName} field specifies a file '{file}' that cannot be opened for required access '{FileAccess}'");
}