Changed Exception to InvalidOperationException

Signed-off-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
Bjarke Berg
2020-10-19 06:38:57 +02:00
parent 31be4b7306
commit f17c4631d2

View File

@@ -1,7 +1,6 @@
using System;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ViewEngines;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Web.Common.Filters;
@@ -28,7 +27,6 @@ namespace Umbraco.Web.Mvc
_compositeViewEngine = compositeViewEngine;
}
/// <summary>
/// Gets the current content item.
/// </summary>
@@ -76,7 +74,7 @@ namespace Umbraco.Web.Mvc
{
var template = ControllerContext.RouteData.Values["action"].ToString();
if (EnsurePhsyicalViewExists(template) == false)
throw new Exception("No physical template file was found for template " + template);
throw new InvalidOperationException("No physical template file was found for template " + template);
return View(template, model);
}