Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs
===================================================================
diff -u -r16559315c0a64fffd05827d249200c62e353231f -rffba5900acc192187346a9ad73acea5e8b9d0bf5
--- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 16559315c0a64fffd05827d249200c62e353231f)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision ffba5900acc192187346a9ad73acea5e8b9d0bf5)
@@ -1331,8 +1331,24 @@
#region CategoryTreeFolder TreeNodeInfo
+ ///
+ /// Gets an based on .
+ ///
+ /// The tree folder category to retrieve the image for.
+ /// An based on .
+ /// Thrown when
+ /// is an invalid value of .
+ /// Thrown when
+ /// is an unsupported value of .
private static Image GetFolderIcon(TreeFolderCategory category)
{
+ if (!Enum.IsDefined(typeof(TreeFolderCategory), category))
+ {
+ throw new InvalidEnumArgumentException(nameof(category),
+ (int) category,
+ typeof(TreeFolderCategory));
+ }
+
switch (category)
{
case TreeFolderCategory.General:
@@ -1342,9 +1358,7 @@
case TreeFolderCategory.Output:
return RingtoetsCommonFormsResources.OutputFolderIcon;
default:
- throw new InvalidEnumArgumentException(nameof(category),
- (int) category,
- typeof(TreeFolderCategory));
+ throw new NotSupportedException($"The enum value {nameof(TreeFolderCategory)}.{category} is not supported.");
}
}