From 1e8b8feee85eac0478470855148adc0d2849cb2b Mon Sep 17 00:00:00 2001 From: Stephan Date: Mon, 4 Feb 2019 17:59:12 +0100 Subject: [PATCH] Make ContainerControllerFactory exceptions more explicit --- src/Umbraco.Web/Mvc/ContainerControllerFactory.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Mvc/ContainerControllerFactory.cs b/src/Umbraco.Web/Mvc/ContainerControllerFactory.cs index 9262903355..cb732fdbb9 100644 --- a/src/Umbraco.Web/Mvc/ContainerControllerFactory.cs +++ b/src/Umbraco.Web/Mvc/ContainerControllerFactory.cs @@ -16,7 +16,14 @@ namespace Umbraco.Web.Mvc protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType) { - return (IController) _container.GetInstance(controllerType); + try + { + return (IController) _container.GetInstance(controllerType); + } + catch (Exception e) + { + throw new Exception($"Failed to create an instance of controller type {controllerType.FullName} (see inner exception).", e); + } } public override void ReleaseController(IController controller)