More specific exception when a conversion fails

This commit is contained in:
Sebastiaan Janssen
2016-08-04 19:13:47 +02:00
parent 9d62b2f5f9
commit b2e7c7a8d4

View File

@@ -135,7 +135,7 @@ namespace Umbraco.Core.Models
private static void ThrowTypeException(object value, Type expected, string alias)
{
throw new Exception(string.Format("Value \"{0}\" of type \"{1}\" could not be converted"
throw new InvalidOperationException(string.Format("Value \"{0}\" of type \"{1}\" could not be converted"
+ " to type \"{2}\" which is expected by property type \"{3}\".",
value, value.GetType(), expected, alias));
}