Skip to content

Commit f13d98d

Browse files
committed
Improved exception for FindResource method
1 parent c63f1de commit f13d98d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Microsoft.Toolkit.Uwp.UI/Extensions/Tree/LogicalTree.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,9 +657,9 @@ public static object FindResource(this FrameworkElement element, object resource
657657
return value!;
658658
}
659659

660-
static object Throw() => throw new Exception("No resource was found with the specified key");
660+
static object Throw(object resourceKey) => throw new KeyNotFoundException($"No resource was found with the key \"{resourceKey}\"");
661661

662-
return Throw();
662+
return Throw(resourceKey);
663663
}
664664

665665
/// <summary>

0 commit comments

Comments
 (0)