diff --git a/src/Umbraco.Core/Models/ContentBase.cs b/src/Umbraco.Core/Models/ContentBase.cs index 0fc3bac044..81808473da 100644 --- a/src/Umbraco.Core/Models/ContentBase.cs +++ b/src/Umbraco.Core/Models/ContentBase.cs @@ -264,7 +264,17 @@ namespace Umbraco.Core.Models /// Value as an public virtual object GetValue(string propertyTypeAlias) { - return Properties[propertyTypeAlias].Value; + try + { + return Properties[propertyTypeAlias].Value; + } + catch (KeyNotFoundException ex) + { + var message = string.Format("Cannot find the property with alias '{0}' for the node named '{1}' with id '{2} that uses the document type alias '{3}'", + propertyTypeAlias, this.Name, this.Id, this.ContentTypeBase.Alias); + + throw new Exception(message, ex); + } } /// @@ -275,8 +285,18 @@ namespace Umbraco.Core.Models /// Value as a public virtual TPassType GetValue(string propertyTypeAlias) { - var convertAttempt = Properties[propertyTypeAlias].Value.TryConvertTo(); - return convertAttempt.Success ? convertAttempt.Result : default(TPassType); + try + { + var convertAttempt = Properties[propertyTypeAlias].Value.TryConvertTo(); + return convertAttempt.Success ? convertAttempt.Result : default(TPassType); + } + catch (KeyNotFoundException ex) + { + var message = string.Format("Cannot find the property with alias '{0}' for the node named '{1}' with id '{2} that uses the document type alias '{3}'", + propertyTypeAlias, this.Name, this.Id, this.ContentTypeBase.Alias); + + throw new Exception(message, ex); + } } ///