Skip to content

Commit

Permalink
Catched the errors from Umbraco.TypedContent
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Zajkowski committed Oct 28, 2016
1 parent ac05ca6 commit 0794a1a
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,25 @@ private IPublishedContent GetPublishedContent(int nodeId, ref UmbracoObjectTypes
}

// attempt to get the content
var content = contentFetcher(nodeId);
if (content != null)
try
{
// if we found the content, assign the expected type to the actual type so we don't have to keep looking for other types of content
actualType = expectedType;
var content = contentFetcher(nodeId);
if (content != null)
{
// if we found the content, assign the expected type to the actual type so we don't have to keep looking for other types of content
actualType = expectedType;
}

return content;
}
catch (Exception ex)
{
// we're catching the errors which are thrown from the Umbraco
// in our case from: https://github.com/umbraco/Umbraco-CMS/blob/5397f2c53acbdeb0805e1fe39fda938f571d295a/src/Umbraco.Web/Security/MembershipHelper.cs
// it's checking for the entity type and the order is content media then member and if membership provider is the custom one then the error will be thrown
LogHelper.Error<MultiNodeTreePickerPropertyConverter>(string.Format("Error during fetching IPublishedContent for nodeId: {0}", nodeId), ex);
}
return content;
return null;
}

}
Expand Down

0 comments on commit 0794a1a

Please sign in to comment.