Skip to content

Instantly share code, notes, and snippets.

@nul800sebastiaan
Created March 27, 2013 17:09
Show Gist options
  • Save nul800sebastiaan/5256117 to your computer and use it in GitHub Desktop.
Save nul800sebastiaan/5256117 to your computer and use it in GitHub Desktop.
Implement Umbraco Macro Error event handler.
using System;
using umbraco.interfaces;
namespace MyNameSpace
{
public class StartupEventHandlers : IApplicationStartupHandler
{
public StartupEventHandlers()
{
umbraco.macro.Error += macro_Error;
}
void macro_Error(object sender, Umbraco.Core.Events.MacroErrorEventArgs e)
{
// Handle errors here
}
}
}
@warrenbuckley
Copy link

Thanks Seb. I can see this being very useful.

@noshitsherlock
Copy link

I know Shannon had an example of this on his blog. For example.

/// <summary>
/// The global.asax class
/// </summary>
public class MyApplication : Umbraco.Web.UmbracoApplication
{
    protected override void OnApplicationStarted(object sender, EventArgs e)
    {
        base.OnApplicationStarted(sender, e);

        // do your stuff
    }
}

Got it from this blogpost.

http://shazwazza.com/post/Using-IoC-with-Umbraco-MVC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment