diff options
author | Rogier van der Hee <rogihee@users.noreply.github.com> | 2016-08-09 12:37:35 +0200 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2016-08-09 11:37:35 +0100 |
commit | 43e90a38840600a2556be38cc331de4a0d948834 (patch) | |
tree | 00b9f4cdd5747fa9b716ee26a50dc2cdcede68ee /Xamarin.Forms.Core/ResourceDictionary.cs | |
parent | 0a73c0f4bbf75d8a83f36b031c3bfd07108ea04b (diff) | |
download | xamarin-forms-43e90a38840600a2556be38cc331de4a0d948834.tar.gz xamarin-forms-43e90a38840600a2556be38cc331de4a0d948834.tar.bz2 xamarin-forms-43e90a38840600a2556be38cc331de4a0d948834.zip |
Add the key in the message on throwing a KeyNotFoundException (#282)
* Add the key in the message on throwing a KeyNotFoundException for trying to access an invalid key in the ResourceDictionary. This helps a lot in tracking down what resource is actually missing.
* Fix test build, use C# 6 string interpolation
Diffstat (limited to 'Xamarin.Forms.Core/ResourceDictionary.cs')
-rw-r--r-- | Xamarin.Forms.Core/ResourceDictionary.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Xamarin.Forms.Core/ResourceDictionary.cs b/Xamarin.Forms.Core/ResourceDictionary.cs index 791c6e5d..0747eaac 100644 --- a/Xamarin.Forms.Core/ResourceDictionary.cs +++ b/Xamarin.Forms.Core/ResourceDictionary.cs @@ -98,7 +98,7 @@ namespace Xamarin.Forms return _innerDictionary[index]; if (_mergedInstance != null && _mergedInstance.ContainsKey(index)) return _mergedInstance[index]; - throw new KeyNotFoundException(); + throw new KeyNotFoundException($"The resource '{index}' is not present in the dictionary."); } set { |