aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-10-26 19:37:36 -0500
committerJP Dillingham <jp@dillingham.me>2026-10-26 19:37:36 -0500
commit9a4d777f43f93fcb5aabcb2ea7b437a1c39f0f0e (patch)
treea26fde6f9e70e2b155eabbaf9979e0f10af952ae
parent404643e58ca7210b1f499e0e4b2f2c04676d1017 (diff)
downloadslskd-9a4d777f43f93fcb5aabcb2ea7b437a1c39f0f0e.tar.gz
better error trapping
-rw-r--r--src/slskd/Common/Validation/FileExistsAttribute.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/slskd/Common/Validation/FileExistsAttribute.cs b/src/slskd/Common/Validation/FileExistsAttribute.cs
index c4d97a7c..4343dec9 100644
--- a/src/slskd/Common/Validation/FileExistsAttribute.cs
+++ b/src/slskd/Common/Validation/FileExistsAttribute.cs
@@ -71,7 +71,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}'");
}