Created
March 27, 2013 17:09
-
-
Save nul800sebastiaan/5256117 to your computer and use it in GitHub Desktop.
Implement Umbraco Macro Error event handler.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} | |
} | |
} |
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks Seb. I can see this being very useful.