Skip to content

Commit 65e9732

Browse files
CopilotBornToBeRoot
andcommitted
Improve exception handling and documentation structure
Co-authored-by: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com>
1 parent bf0c78e commit 65e9732

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Source/NETworkManager.Settings/SettingsManager.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,18 @@ public static string GetSettingsFolderLocation()
9292
// Validate that the path doesn't contain invalid characters
9393
try
9494
{
95-
// This will throw if the path contains invalid characters
95+
// This will throw ArgumentException or NotSupportedException if the path contains invalid characters
9696
_ = Path.GetFullPath(policyPath);
9797
return policyPath;
9898
}
99-
catch (Exception ex)
99+
catch (ArgumentException ex)
100100
{
101101
Log.Error($"Policy-provided SettingsFolderLocation contains invalid characters: {policyPath}. Falling back to default location.", ex);
102102
}
103+
catch (NotSupportedException ex)
104+
{
105+
Log.Error($"Policy-provided SettingsFolderLocation format is not supported: {policyPath}. Falling back to default location.", ex);
106+
}
103107
}
104108
}
105109

Website/docs/system-wide-policies.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The `config.json` file uses a simple JSON structure to define policy values. An
3232
```
3333

3434

35-
**Example:**
35+
**Example with available policies:**
3636

3737
```json
3838
{
@@ -41,6 +41,8 @@ The `config.json` file uses a simple JSON structure to define policy values. An
4141
}
4242
```
4343

44+
For a complete list of available policies, see the [Available Policies](#available-policies) section below.
45+
4446
Property names generally follow the pattern `Section_SettingName` (see each setting's documentation). Ensure values use the correct JSON type (boolean, string, number, etc.).
4547

4648
:::note

0 commit comments

Comments
 (0)