Created a EntityNotFoundException to use when we are expecting an umbraco entity found. Updates some code to use this exception.

This commit is contained in:
Shannon
2014-02-17 11:50:13 +11:00
parent 8b6583b554
commit 13976559a8
4 changed files with 56 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ using System.Web.Http;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Models.EntityBase;
using Umbraco.Core.Persistence;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.WebApi.Filters;
using umbraco;
@@ -88,6 +89,10 @@ namespace Umbraco.Web.Trees
{
//just return their single start node, it will show up under the 'Content' label
var startNode = Services.EntityService.Get(UserStartNode, UmbracoObjectType);
if (startNode == null)
{
throw new EntityNotFoundException(UserStartNode, "User's start content node could not be found");
}
return new[] { startNode };
}