summaryrefslogtreecommitdiffstats
path: root/Scripts/YOTSCore.cs
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-08-18 18:07:25 -0700
committeryum <yum.food.vr@gmail.com>2025-08-18 18:14:32 -0700
commitce52a617927f9fd778ca48c27151a23dc4a3fc31 (patch)
treec361c94bf5aedd6fd4adbfeaaea9c358fbc2a282 /Scripts/YOTSCore.cs
parentb6eaff0fba81d952d9002cb04dca9bd5887d3757 (diff)
Improve error reporting
Diffstat (limited to 'Scripts/YOTSCore.cs')
-rw-r--r--Scripts/YOTSCore.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Scripts/YOTSCore.cs b/Scripts/YOTSCore.cs
index 49f54d7..d76f382 100644
--- a/Scripts/YOTSCore.cs
+++ b/Scripts/YOTSCore.cs
@@ -673,7 +673,7 @@ namespace YOTS
// Find the toggle with this dependency name
var depToggle = toggleSpecs.FirstOrDefault(t => t.name == dep);
if (depToggle == null) {
- throw new System.Exception($"Toggle '{toggle.name}' has dependency '{dep}' that doesn't exist");
+ throw new ArgumentException($"Toggle '{toggle.name}' has dependency '{dep}' that doesn't exist");
}
string depParamName = depToggle.GetParameterName();
if (!graph.ContainsKey(depParamName))
@@ -731,9 +731,10 @@ namespace YOTS
// Provide detailed error message
if (cycleNodes.Count == 0) {
- throw new System.Exception($"Dependency cycle detected but couldn't identify specific nodes. Unprocessed parameters: {string.Join(", ", unprocessedParams)}");
+ // This should never happen.
+ throw new ArgumentException($"Dependency cycle detected but couldn't identify specific nodes. Unprocessed parameters: {string.Join(", ", unprocessedParams)}");
} else {
- throw new System.Exception($"Dependency cycle detected in toggle specifications. Nodes involved: {string.Join(", ", cycleNodes)}");
+ throw new ArgumentException($"Dependency cycle detected in toggle specifications. Nodes involved: {string.Join(", ", cycleNodes)}");
}
}