U4-3279 - better exception message when failing to find a content type

This commit is contained in:
Stephan
2013-10-31 18:28:02 +01:00
parent 7b29bd67f3
commit 767719357e

View File

@@ -145,6 +145,10 @@ namespace Umbraco.Core.Models.PublishedContent
? (IContentTypeComposition) ApplicationContext.Current.Services.ContentTypeService.GetContentType(alias)
: (IContentTypeComposition) ApplicationContext.Current.Services.ContentTypeService.GetMediaType(alias);
if (contentType == null)
throw new Exception(string.Format("ContentTypeService failed to find a {0} type with alias \"{1}\".",
itemType.ToString().ToLower(), alias));
return new PublishedContentType(contentType);
}