Fix exception types as per review

This commit is contained in:
Kenn Jacobsen
2019-04-08 07:24:56 +02:00
parent 2ee8f9dea2
commit 1aec0e1d9c

View File

@@ -327,13 +327,13 @@ namespace Umbraco.Web.Editors
var contentType = Services.ContentTypeService.Get(id);
if (contentType == null)
{
throw new NullReferenceException("No content type found with id " + id);
throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound, "No content type found with id " + id));
}
var template = CreateTemplateForContentType(contentType.Alias, contentType.Name);
if (template == null)
{
throw new NullReferenceException("Could not create default template for content type with id " + id);
throw new InvalidOperationException("Could not create default template for content type with id " + id);
}
return Mapper.Map<TemplateDisplay>(template);