Dictionary params & error handling

This commit is contained in:
Lars-Erik Aabech
2018-09-02 22:09:37 +02:00
committed by Lars-Erik Aabech
parent 70d93d4668
commit bc80affcf1
7 changed files with 69 additions and 15 deletions

View File

@@ -1,4 +1,5 @@
using System.Web;
using System;
using System.Web;
using Umbraco.Core;
using Umbraco.Core.Composing;
@@ -16,9 +17,20 @@ namespace Umbraco.Web.Composing
/// <inheritdoc />
public void Init(HttpApplication context)
{
// using the service locator here - no other way, really
Module = Current.Container.GetInstance<TModule>();
Module.Init(context);
try
{
// using the service locator here - no other way, really
Module = Current.Container.GetInstance<TModule>();
Module.Init(context);
}
catch
{
var runtimeState = Current.Container.GetInstance<IRuntimeState>();
if (runtimeState.BootFailedException != null)
{
throw new Exception("Failed to boot", runtimeState.BootFailedException);
}
}
}
/// <inheritdoc />